Class TLcdDAFIFRunwayDecoder
- All Implemented Interfaces:
ILcdDAFIFDecoder
,ILcdInputStreamFactoryCapable
,ILcdModelDecoder
- Direct Known Subclasses:
TLcdDAFIFIndependentRunwayDecoder
ALcdDAFIFSingleModelDecoder
decodes
runways from a DAFIF source file. Decoded models have as model descriptor
an instance of TLcdDAFIFRunwayModelDescriptor
.
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.Runway
,
which can also be retrieved through ILcdDataObject.getDataType()
.
The available properties of the objects are defined in TLcdDAFIFRunwayDataProperties
.
The values for these properties can be retrieved through ILcdDataObject.getValue(com.luciad.datamodel.TLcdDataProperty)
.
-
Field Summary
Fields inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
DAFIF_PROP_EXTENSION, fRecordCount
-
Constructor Summary
ConstructorsConstructorDescriptionTLcdDAFIFRunwayDecoder
(ALcdAISObjectFactory aFactory) Deprecated.TLcdDAFIFRunwayDecoder
(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties) Deprecated.Constructs a newTLcdDAFIFRunwayDecoder
object.TLcdDAFIFRunwayDecoder
(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties) Constructs a newTLcdDAFIFRunwayDecoder
object. -
Method Summary
Modifier and TypeMethodDescriptionprotected ILcdModelDescriptor
createModelDescriptor
(String aSource) Creates and returns the model descriptor to be set on the model returned in thedecode
method.void
Adds a unique index on specified model of aerodromes.Returns a model containing domain objects read from the given source file.Returns the name of the file to be decoded.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.protected final void
handleRecord
(int aFormat, char[] aRecord) Deals with one record of input.static boolean
Returns a boolean indicating whether the arresting gear model will be decoded or not.protected double
readHighEndLat
(char[] aRecord) Reads the high end latitude.protected double
readHighEndLon
(char[] aRecord) Reads the high end longitude.protected ILcdGeodeticDatum
readLocalHorizontalDatumFromFmt1
(char[] aRecord) Reads the local horizontal datum from a record of format 01.protected double
readLowEndLat
(char[] aRecord) Reads the low end latitude.protected double
readLowEndLon
(char[] aRecord) Reads the low end longitude.void
setAerodromeModel
(ILcdFeatureIndexedModel aAirportsModel) Specifies an aerodrome model.void
setArrestingGearFeaturesToBeDecoded
(String[] aArrestingGearFeaturesToBeDecoded) Specifies the features that should be decoded into the arresting gear objects of the model that will be returned by thedecode
method.static void
setDecodeArrestingGear
(boolean aDecodeArrestingGear) Specify whether the arresting gear model should be added or not while decoding the runways.void
setRunwayDefaultDisplayNameIndex
(int aIndex) Specifies the index of the feature to be used as display name.void
setRunwayDirectionDefaultDisplayNameIndex
(int aIndex) Specifies the index of the feature to be used as display name.void
setRunwayDirectionFeaturesToBeDecoded
(String[] aRunwayDirectionFeaturesToBeDecoded) Specifies the features that should be decoded into the runway direction objects of the model that will be returned by thedecode
method.void
setRunwayFeaturesToBeDecoded
(String[] aRunwayFeaturesToBeDecoded) Specifies the features that should be decoded into the runway objects of the model that will be returned by thedecode
method.Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFSingleModelDecoder
cleanUp, setKeyFeatureNames
Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Constructor Details
-
TLcdDAFIFRunwayDecoder
Deprecated.Constructs a newTLcdDAFIFRunwayDecoder
object. The user should specify which domainFactory he or she wants to use to create the runways.- Parameters:
aFactory
- the factory to be used to create the model objects
-
TLcdDAFIFRunwayDecoder
Constructs a newTLcdDAFIFRunwayDecoder
object. The user should specify which factory he or she wants to use to create the runways.- Parameters:
aFactory
- the factory to be used to create the model objects
-
TLcdDAFIFRunwayDecoder
Constructs a newTLcdDAFIFRunwayDecoder
object. The user should specify which domainFactory he or she wants to use to create the runways.- Parameters:
aFactory
- the factory to be used to create the model objectsaDAFIFProperties
- aProperties
object that contains for each domain object the appropriate file name
-
TLcdDAFIFRunwayDecoder
@Deprecated public TLcdDAFIFRunwayDecoder(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties) Deprecated.Constructs a newTLcdDAFIFRunwayDecoder
object. The user should specify which domainFactory he or she wants to use to create the runways.- Parameters:
aFactory
- the factory to be used to create the model objectsaDAFIFProperties
- aProperties
object that contains for each domain object the appropriate file name
-
-
Method Details
-
getDecodeFileName
Description copied from interface:ILcdDAFIFDecoder
Returns the name of the file to be decoded.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.
- Returns:
- the name of the source file
-
getDisplayName
Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Overrides:
getDisplayName
in classALcdDAFIFDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
handleRecord
protected final void handleRecord(int aFormat, char[] aRecord) Description copied from class:ALcdDAFIFSingleModelDecoder
Deals with one record of input.- Specified by:
handleRecord
in classALcdDAFIFSingleModelDecoder
- Parameters:
aFormat
- the format of the recordaRecord
- the record
-
decode
Description copied from class:ALcdDAFIFSingleModelDecoder
Returns a model containing domain objects read from the given source file.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.
- Specified by:
decode
in interfaceILcdModelDecoder
- Overrides:
decode
in classALcdDAFIFSingleModelDecoder
- Parameters:
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 (seegetDecodeFileName()
).- Returns:
- the model build by reading the file found with aSource
- Throws:
IOException
- if an error occurs during the reading process- See Also:
-
createModelDescriptor
Description copied from class:ALcdDAFIFSingleModelDecoder
Creates and returns the model descriptor to be set on the model returned in thedecode
method.- Specified by:
createModelDescriptor
in classALcdDAFIFSingleModelDecoder
- Parameters:
aSource
- the source that will be used to decode- Returns:
- a model descriptor describing the data in the model created in the decode method
-
setRunwayDefaultDisplayNameIndex
public void setRunwayDefaultDisplayNameIndex(int aIndex) Specifies the index of the feature to be used as display name.- Parameters:
aIndex
- the index of the feature to be used as display name
-
setRunwayDirectionDefaultDisplayNameIndex
public void setRunwayDirectionDefaultDisplayNameIndex(int aIndex) Specifies the index of the feature to be used as display name.- Parameters:
aIndex
- the index of the feature to be used as display name
-
setAerodromeModel
Specifies an aerodrome model. Make sure there is a unique index on this model!- Parameters:
aAirportsModel
-- See Also:
-
createRequiredIndex
Adds a unique index on specified model of aerodromes. This method should be called before callingsetAerodromeModel
method.Please make sure that the
ILcdAerodromeFeature.IDENTIFICATION
feature was decoded into the model objects of the specified aerodrome model.- Parameters:
aModel
- a model containing the aerodromes- See Also:
-
isDecodeArrestingGear
public static boolean isDecodeArrestingGear()Returns a boolean indicating whether the arresting gear model will be decoded or not.- See Also:
-
setDecodeArrestingGear
public static void setDecodeArrestingGear(boolean aDecodeArrestingGear) Specify whether the arresting gear model should be added or not while decoding the runways.- Parameters:
aDecodeArrestingGear
- Whether the arresting gear should be decoded.- See Also:
-
setRunwayFeaturesToBeDecoded
Specifies the features that should be decoded into the runway objects of the model that will be returned by thedecode
method. Please make sure that theILcdDAFIFRunwayFeature.AERODROME_IDENTIFICATION
, theILcdDAFIFRunwayFeature.HIGH_END_IDENTIFIER
and theILcdDAFIFRunwayFeature.LOW_END_IDENTIFIER
features are in your list.- Parameters:
aRunwayFeaturesToBeDecoded
- a list of features that should be decoded into the runway objects
-
setRunwayDirectionFeaturesToBeDecoded
Specifies the features that should be decoded into the runway direction objects of the model that will be returned by thedecode
method.Please make sure that the
ILcdRunwayDirectionFeature.IDENTIFIER
feature is in your list.- Parameters:
aRunwayDirectionFeaturesToBeDecoded
- a list of features that should be decoded into the runway direction objects
-
setArrestingGearFeaturesToBeDecoded
Specifies the features that should be decoded into the arresting gear objects of the model that will be returned by thedecode
method.- Parameters:
aArrestingGearFeaturesToBeDecoded
- a list of features that should be decoded into the arresting gear objects
-
readHighEndLon
protected double readHighEndLon(char[] aRecord) Reads the high end longitude. The resulting value may be a geodetic or a source longitude depending on the value of isGeodetic. -
readHighEndLat
protected double readHighEndLat(char[] aRecord) Reads the high end latitude. The resulting value may be a geodetic or a source latitude depending on the value of isGeodetic.- Parameters:
aRecord
-
-
readLowEndLon
protected double readLowEndLon(char[] aRecord) Reads the low end longitude. The resulting value may be a geodetic or a source longitude depending on the value of isGeodetic. -
readLowEndLat
protected double readLowEndLat(char[] aRecord) Reads the low end latitude. The resulting value may be a geodetic or a source latitude depending on the value of isGeodetic. -
readLocalHorizontalDatumFromFmt1
Reads the local horizontal datum from a record of format 01. This field must not be empty.
-