public class TLcdARINCDecoder extends Object implements ILcdARINCDecoder, ILcdInputStreamFactoryCapable
ILcdARINCDecoder
.
File | Required | Entry point | Description |
---|---|---|---|
*.dat | x | Data file containing a ARINC data | |
*.pc | x | Data file containing a ARINC data |
ILcdInputStreamFactory
of this decoder.ILcd2DBoundsIndexedModel
.TLcdARINC...ModelDescriptor
according to the object type.Model Descriptor | Display Name |
---|---|
TLcdARINCDMEModelDescriptor | DME |
TLcdARINCILSModelDescriptor | ILS |
TLcdARINCMarkerModelDescriptor | Marker |
TLcdARINCNDBModelDescriptor | NDB |
TLcdARINCTACANModelDescriptor | TACAN |
TLcdARINCVORModelDescriptor | VOR |
TLcdARINCWayPointModelDescriptor | Waypoint |
TLcdGeodeticReference
.TLcdGeodeticDatum
(WGS-84).ARINC data type
.
For more information about the model and its elements, see the com.luciad.format.arinc.model
package
and its sub-packages.
ILcdModelDecoder decoder = new TLcdARINCDecoder();
ILcdModel model = decoder.decode("arinc.pc");
Constructor and Description |
---|
TLcdARINCDecoder()
Constructs a new
TLcdARINCDecoder object with no
ILcdARINCHandler installed. |
Modifier and Type | Method and Description |
---|---|
void |
addHandlerForTypeToBeDecoded(ILcdARINCHandler aHandler)
Adds an
ILcdARINCHandler to the decoder. |
boolean |
canDecodeSource(String aSource)
Returns true when the file or data source pointed to by 'aSource'
is recognized as a decodable Arinc format.
|
ILcdModel |
decode(String aSource)
Decodes the given source and returns an
ILcdModel containing the decoded ARINC objects. |
ILcdBounds |
getBoundsToFilterOn()
Returns the (geodetic) bounds to filter on.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
String |
getErrorMessage()
Returns the error message of the last decode call (when an error occurred).
|
ILcdARINCHandler |
getHandlerForTypeToBeDecoded(int aIndex)
Returns the handler with the given index.
|
int |
getHandlerForTypeToBeDecodedCount()
Returns the number of handlers set on this decoder.
|
ILcdBounds |
getInitialBounds()
Returns the initial bounds for each model created
in the
decode method. |
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is currently used for creating input streams
given source names.
|
static boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
removeAllHandlersForTypeToBeDecoded()
Removes all handlers from this decoder.
|
void |
setBoundsToFilterOn(ILcdBounds aBoundsToFilterOn)
Specifies the (geodetic) bounds that will be used as a filter on each model
created in the
decode method. |
void |
setInitialBounds(ILcdBounds aInitialBounds)
Specifies the bounds to be used as initial bounds for each model created
in the
decode method. |
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory that will be used for creating input streams
given source names.
|
static void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public TLcdARINCDecoder()
TLcdARINCDecoder
object with no
ILcdARINCHandler
installed.
To decode one or more ARINC domain objects (e.g. navaids, routes, airspaces, ...), it is
necessary to register one or more ILcdARINCHandler
objects through
addHandlerForTypeToBeDecoded(ILcdARINCHandler)
.public boolean canDecodeSource(String aSource)
canDecodeSource
in interface ILcdModelDecoder
aSource
- the source to be decodedILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSource) throws IOException
ILcdModel
containing the decoded ARINC objects.
Before invoking this method, a handler (ILcdARINCHandler
) should be registered on this decoder
for each type of object that must be decoded, through addHandlerForTypeToBeDecoded(ILcdARINCHandler)
.
For example, a TLcdARINCAerodromeHandler
can be registered to decode Aerodrome objects.
For each handler registered on this decoder, a new model will be created. When multiple
handlers are registered, a TLcdModelList
is returned containing all the created models,
with an instance of TLcdARINCModelListDescriptor
as model descriptor.
If necessary, this model list can be decomposed back into a set of individual models
If no handlers are registered at all, an empty model will be returned.decode
in interface ILcdModelDecoder
aSource
- the full path to the file to be decoded, including the file name.IOException
- thrown if an error occurs during the read process.ILcdModelDecoder.canDecodeSource(String)
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public void addHandlerForTypeToBeDecoded(ILcdARINCHandler aHandler)
ILcdARINCDecoder
ILcdARINCHandler
to the decoder.
Each handler will generate an ILcdModel
containing one specific kind of domain
object. At the end of the decode process, the models created by the available handlers
will be brought together in a TLcdModelList
.
addHandlerForTypeToBeDecoded
in interface ILcdARINCDecoder
aHandler
- an ILcdARINCHandler
implementationILcdARINCDecoder.getHandlerForTypeToBeDecoded(int)
,
ILcdARINCDecoder.getHandlerForTypeToBeDecodedCount()
public ILcdARINCHandler getHandlerForTypeToBeDecoded(int aIndex)
ILcdARINCDecoder
getHandlerForTypeToBeDecoded
in interface ILcdARINCDecoder
aIndex
- the index in the list of handlersILcdARINCDecoder.addHandlerForTypeToBeDecoded(com.luciad.format.arinc.decoder.ILcdARINCHandler)
,
ILcdARINCDecoder.getHandlerForTypeToBeDecodedCount()
public int getHandlerForTypeToBeDecodedCount()
ILcdARINCDecoder
getHandlerForTypeToBeDecodedCount
in interface ILcdARINCDecoder
ILcdARINCDecoder.addHandlerForTypeToBeDecoded(com.luciad.format.arinc.decoder.ILcdARINCHandler)
,
ILcdARINCDecoder.getHandlerForTypeToBeDecoded(int)
public void removeAllHandlersForTypeToBeDecoded()
ILcdARINCDecoder
removeAllHandlersForTypeToBeDecoded
in interface ILcdARINCDecoder
ILcdARINCDecoder.addHandlerForTypeToBeDecoded(com.luciad.format.arinc.decoder.ILcdARINCHandler)
public String getErrorMessage()
ILcdARINCDecoder
Note: the error message can only be retrieved once after a decode call.
getErrorMessage
in interface ILcdARINCDecoder
public ILcdBounds getBoundsToFilterOn()
ILcdARINCDecoder
getBoundsToFilterOn
in interface ILcdARINCDecoder
ILcdARINCDecoder.setBoundsToFilterOn(com.luciad.shape.ILcdBounds)
public ILcdBounds getInitialBounds()
ILcdARINCDecoder
decode
method.getInitialBounds
in interface ILcdARINCDecoder
decode
methodILcdARINCDecoder.setInitialBounds(com.luciad.shape.ILcdBounds)
public void setBoundsToFilterOn(ILcdBounds aBoundsToFilterOn)
ILcdARINCDecoder
decode
method.
If this bounds is null, all objects found in the input file will be inserted into the model. If this bounds is not null, only the objects whose bounds interact with the specified bounds will be inserted into the model.
setBoundsToFilterOn
in interface ILcdARINCDecoder
aBoundsToFilterOn
- the bounds to be used as a filterpublic void setInitialBounds(ILcdBounds aInitialBounds)
ILcdARINCDecoder
decode
method.
This bounds should be large enough to enclose (most of) the model objects. This option can improve performance by avoiding too many expansions of the model bounds.
This parameter may be null.
Note: This bounds is not a filter! If a model objects bounds does not interact with aInitialBounds, aInitialBounds will be enlarged to enclose the object.
setInitialBounds
in interface ILcdARINCDecoder
aInitialBounds
- the initial bounds for each model created in the decode
methodpublic void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public static boolean isTraceOn()
true
if tracing is enabled for this class.public static void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.aTraceOn
- if true then all log messages are recorded for this
instance. If false, then only the informative, warning and
error log messages are recorded.