Package com.luciad.format.asdi
Class TLcdASDIModelDecoder
java.lang.Object
com.luciad.format.asdi.ALcdASDIDecoder
com.luciad.format.asdi.TLcdASDIModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable,ILcdModelDecoder
@LcdService(service=ILcdModelDecoder.class,
priority=20000)
public class TLcdASDIModelDecoder
extends ALcdASDIDecoder
implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This decoder reads data from an ASDI feed and returns the information
in a
The domain objects group messages that belong together.
TLcdModelList, allowing for easy manipulation of that data,
such as replaying, analysis, etc.
An ASDI file can contain a <set time > MM/dd/yyyy HH:mm:ss
command at the first line. If this is the case the corresponding date
is used as the start time for the decoder,
the start time set by ALcdASDIDecoder.setStartTime(long) is ignored then.
Input files
| File | Required | Entry point | Description |
|---|---|---|---|
| *.asdi | x | x | ASDI file containing an ASDI formatted data |
Supported file transfer protocols
- This model decoder supports all transfer protocols that are supported by
the
ILcdInputStreamFactoryof this decoder.
Model structure
- This model decoder returns a
model listwith a model for each data type in the input. - The model list contains different
ILcdModelobjects, depending on the type of messages in the ASDI feed. - All models returned by this model decoder implement
ILcd2DBoundsIndexedModel.
Model descriptor
- All
ILcdModelobjects have anILcdModelDescriptorthat is anALcdASDIModelDescriptor. The methodALcdASDIModelDescriptor.getDataType()allows to distinguish between the different models.
Model reference
- All models returned by this model decoder have a
TLcdGeodeticReference. - The used datum is a standard
TLcdGeodeticDatum(WGS-84).
Model elements
All domain objects decoded with this decoder implement the ILcdDataObject interface. This interface allows you to retrieve information on each of the domain models of ASDI in a uniform way. The data models and types can be obtained from either the domain objects or from the TLcdASDIDataTypes class. Following table gives an overview of the different models in theTLcdModelList,
specifying for each a description, the messages taken into account,
the domain objects in the model and the value returned from
ALcdASDIModelDescriptor.getDataType() :
| Model description | ASDI messages | Domain objects | ALcdASDIModelDescriptor.getDataType() |
|---|---|---|---|
| TZ tracks | TZ | TLcdASDITrajectory |
DATA_TYPE_TZ_TRACK |
| TO tracks | TO | TLcdASDITrajectory |
DATA_TYPE_TO_TRACK |
| Flight plan data | FZ, AF, DZ, UZ, AZ, RZ and RT | TLcdASDIFlightPlanHistory |
DATA_TYPE_FLIGHT_PLAN |
The domain objects group messages that belong together.
Sample code
ILcdModelDecoder decoder = new TLcdASDIModelDecoder();
ILcdModel model = decoder.decode( "asdi_data.asdi" );
Performance tips
Thread safety
- The decoding of models is thread-safe, as long as no properties are changed during the decoding.
- The decoded models are thread-safe for read access.
Supported versions
- This decoder supports version 5.4 of the ASDI standard.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aTLcdASDIModelDecoder, a model decoder for decoding ASDI data. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecodeSource(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.Returns the input stream factory that is currently used for creating input streams given source names.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory that will be used for creating input streams given source names.Methods inherited from class com.luciad.format.asdi.ALcdASDIDecoder
getMessageFilter, getStartTime, setMessageFilter, setStartTimeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Constructor Details
-
TLcdASDIModelDecoder
public TLcdASDIModelDecoder()Creates aTLcdASDIModelDecoder, a model decoder for decoding ASDI data.
-
-
Method Details
-
setInputStreamFactory
Sets the input stream factory that will be used for creating input streams given source names.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used.
-
getInputStreamFactory
Returns the input stream factory that is currently used for creating input streams given source names.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the input stream factory that is currently used.
-
getDisplayName
Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
canDecodeSource
Description copied from interface:ILcdModelDecoderChecks whether this model decoder can decode the specified data source. It is acceptable for this method to returntruefor a source name whiledecodethrows an exception for that same source name.For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.
- Specified by:
canDecodeSourcein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be verified; typically a file name or a URL.- Returns:
trueif this decoder can likely decode the data specified by the source name,falseotherwise.- See Also:
-
decode
Description copied from interface:ILcdModelDecoderCreates a new model from the given data source.- Specified by:
decodein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
nullis allowed, implementors are advised to throw an error instead. - Throws:
IOException- for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException, IllegalArgumentException, ...) on unexpected places, implementations are advised to catch RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated in the code snippet below.public ILcdModel decode( String aSourceName ) throws IOException { try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) { // Perform decoding ... } catch (RuntimeException e) { throw new IOException(e); } }- See Also:
-