public class TLcdDAFIFMilitaryTrainingRouteDecoder extends ALcdDAFIFSingleModelDecoder
ALcdDAFIFSingleModelDecoder
decodes
military training routes from a DAFIF source file. Decoded models have
as model descriptor an instance of TLcdDAFIFMilitaryTrainingRouteModelDescriptor
.
The objects in decoded models are based on the AIS domain objects available in com.luciad.ais.model
,
which all implement ILcdDataObject
. This interface provides a generic and
format-independent way of accessing the type and properties (features) of a domain object.
For this decoder, the type of the decoded objects is TLcdDAFIFDataTypes.MilitaryTrainingRoute
,
which can also be retrieved through ILcdDataObject.getDataType()
.
The available properties of the objects are defined in TLcdDAFIFMilitaryTrainingRouteDataProperties
.
The values for these properties can be retrieved through ILcdDataObject.getValue(com.luciad.datamodel.TLcdDataProperty)
.
Next to ILcdDataObject
, the objects in decoded models also implement ILcdFeatured
,
the former interface to access the properties (features) of a domain object.
This is still fully supported, and explained in the following comments.
The setRouteFeaturesToBeDecoded
method, the
setRouteSegmentFeaturesToBeDecoded
method
and setRoutePointFeaturesToBeDecoded
method
allow the user to specify which DAFIF features are decoded into the featured model objects.
If no features to be decoded are specified, all features will be decoded.
The following fields (taken from the National Imagery and Mapping Agency (NIMA) Product Specifications for Digital Aeronautical Flight Information File (DAFIF), Seventh Edition, May 2001) are supported by the decoder. The list indicates into which feature the fields are decoded.
DAFIF decoders rely on a specific set of key features that uniquely define an object. This set of features must always be included in the set of features to be decoded. For military training routes the key features are:
DAFIF_PROP_EXTENSION, fRecordCount
Constructor and Description |
---|
TLcdDAFIFMilitaryTrainingRouteDecoder(ALcdAISObjectFactory aDomainFactory)
Deprecated.
|
TLcdDAFIFMilitaryTrainingRouteDecoder(ALcdAISObjectFactory aDomainFactory,
Properties aDAFIFProperties)
Deprecated.
|
TLcdDAFIFMilitaryTrainingRouteDecoder(TLcdAISDataObjectFactory aFactory)
Creates a new
TLcdDAFIFMilitaryTrainingRouteDecoder . |
TLcdDAFIFMilitaryTrainingRouteDecoder(TLcdAISDataObjectFactory aFactory,
Properties aDAFIFProperties)
Creates a new
TLcdDAFIFMilitaryTrainingRouteDecoder . |
Modifier and Type | Method and Description |
---|---|
protected ILcdModelDescriptor |
createModelDescriptor(String aSource)
Creates and returns the model descriptor to be set on the model returned in the
decode method. |
ILcdModel |
decode(String aSource)
Returns a model containing domain objects read from the given source file.
|
String |
getDecodeFileName()
Returns the name of the file to be decoded.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
protected void |
handleRecord(int aFormat,
char[] aRecord)
Deals with one record of input.
|
void |
setRouteDefaultDisplayNameIndex(int aIndex)
Specifies the index of the feature to be the
route display name.
|
void |
setRouteFeaturesToBeDecoded(String[] aRouteFeaturesToBeDecoded)
Specifies a list of features to be decoded into the military training route model objects.
|
void |
setRoutePointDefaultDisplayNameIndex(int aIndex)
Specifies the index of the feature to be the
route point display name.
|
void |
setRoutePointFeaturesToBeDecoded(String[] aRoutePointFeaturesToBeDecoded)
Specifies a list of features to be decoded into the
military training route points.
|
void |
setRouteSegmentFeaturesToBeDecoded(String[] aRouteSegmentFeaturesToBeDecoded)
Specifies a list of features to be decoded into the military training route segments.
|
cleanUp, setKeyFeatureNames
addErrorReport, canDecodeSource, getAltitudeType, getBearingTypeForChar, getBounds, getDAFIFProperties, getDataObjectFactory, getDecodingBounds, getDomainFactory, getErrorMessage, getInputStream, getInputStreamFactory, getLocalHorizontalDatum, getModelFilter, getRecordCount, initializeErrorMessage, isStoreOriginalReference, isTraceOn, loadCFGProperties, read, readExactValue, readFormat, readMinLength, readRecord, setBounds, setDAFIFModelFilter, setDAFIFProperties, setDataObjectFactory, setDecodingBounds, setDomainFactory, setInputStreamFactory, setStoreOriginalReference, setTraceOn, transformPointToReferenceDatumSFCT
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
@Deprecated public TLcdDAFIFMilitaryTrainingRouteDecoder(ALcdAISObjectFactory aDomainFactory)
TLcdDAFIFMilitaryTrainingRouteDecoder
. The user
should specify which domainFactory he or she wants to use to create the military training routes.aDomainFactory
- the factory to be used to create the model objectspublic TLcdDAFIFMilitaryTrainingRouteDecoder(TLcdAISDataObjectFactory aFactory)
TLcdDAFIFMilitaryTrainingRouteDecoder
. The user
should specify which factory he or she wants to use to create the military training routes.aFactory
- the factory to be used to create the model objects@Deprecated public TLcdDAFIFMilitaryTrainingRouteDecoder(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties)
TLcdDAFIFMilitaryTrainingRouteDecoder
. The user
should specify which domainFactory he or she wants to use to create the military training routes.aDomainFactory
- the factory to be used to create the model objectsaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic TLcdDAFIFMilitaryTrainingRouteDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
TLcdDAFIFMilitaryTrainingRouteDecoder
. The user
should specify which domainFactory he or she wants to use to create the military training routes.aFactory
- the factory to be used to create the model objectsaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
getDisplayName
in class ALcdDAFIFDecoder
ILcdModelDecoder
.public String getDecodeFileName()
ILcdDAFIFDecoder
Each domain object has its own file name. This method returns the name of the data file for the domain objects decoded by this DAFIF decoder.
public ILcdModel decode(String aSource) throws IOException
ALcdDAFIFSingleModelDecoder
The model will be build by looping through the records found in the source file.
Each record will be manipulated by the abstract handleRecord
method.
Furthermore, the error message will be initialized and filled with reports about errors occurred during the decode proces.
decode
in interface ILcdModelDecoder
decode
in class ALcdDAFIFSingleModelDecoder
aSource
- either the directory containing the DAFIF source file to decode (if you did not
specify a properties file in the constructor, the default file name will be used), a .toc file
containing the DAFIF properties (the data file should be in the same directory as the .toc file)
or a single file which name corresponds to the file name associated with this decoder
(see getDecodeFileName()
).IOException
- if an error occurs during the reading processILcdModelDecoder.canDecodeSource(String)
protected final void handleRecord(int aFormat, char[] aRecord)
ALcdDAFIFSingleModelDecoder
handleRecord
in class ALcdDAFIFSingleModelDecoder
aFormat
- the format of the recordaRecord
- the recordprotected ILcdModelDescriptor createModelDescriptor(String aSource)
ALcdDAFIFSingleModelDecoder
decode
method.createModelDescriptor
in class ALcdDAFIFSingleModelDecoder
aSource
- the source that will be used to decodepublic void setRouteDefaultDisplayNameIndex(int aIndex)
aIndex
- the index of the feature to be used as display namepublic void setRoutePointDefaultDisplayNameIndex(int aIndex)
aIndex
- the index of the feature to be used as display namepublic void setRouteFeaturesToBeDecoded(String[] aRouteFeaturesToBeDecoded)
Please make sure that the IDENTIFIER
feature is in your list of features to be decoded!
aRouteFeaturesToBeDecoded
- a list of features that should be decoded into the route objectspublic void setRouteSegmentFeaturesToBeDecoded(String[] aRouteSegmentFeaturesToBeDecoded)
aRouteSegmentFeaturesToBeDecoded
- a list of features that should be decoded into the route segment objectspublic void setRoutePointFeaturesToBeDecoded(String[] aRoutePointFeaturesToBeDecoded)
aRoutePointFeaturesToBeDecoded
- a list of features that should be decoded into the route point objects