Class TLcdDAFIFHoldingDecoder
- All Implemented Interfaces:
ILcdDAFIFDecoder,ILcdInputStreamFactoryCapable,ILcdModelDecoder
- Direct Known Subclasses:
TLcdDAFIFIndependentHoldingDecoder
ALcdDAFIFSingleModelDecoder decodes
holdings from a DAFIF source file. Decoded models have as model descriptor
an instance of TLcdDAFIFHoldingModelDescriptor.
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.Holding,
which can also be retrieved through ILcdDataObject.getDataType().
The available properties of the objects are defined in TLcdDAFIFHoldingDataProperties.
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
ConstructorsConstructorDescriptionTLcdDAFIFHoldingDecoder(ALcdAISObjectFactory aFactory) Deprecated.TLcdDAFIFHoldingDecoder(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties) Deprecated.Constructs a newTLcdDAFIFHoldingDecoderobject.TLcdDAFIFHoldingDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties) Constructs a newTLcdDAFIFHoldingDecoderobject. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.luciad.format.dafif.decoder.ILcdModelBuilderSupportprotected ILcdModelDescriptorcreateModelDescriptor(String aSource) Creates and returns the model descriptor to be set on the model returned in thedecodemethod.voidAdds a unique index on specified model of waypoints.Calls the decode method ofALcdDAFIFSingleModelDecoder.Returns the name of the file to be decoded.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.protected final voidhandleRecord(int aFormat, char[] aRecord) Deals with one record of input.voidsetHoldingDefaultDisplayNameIndex(int aIndex) Specifies the index of the feature to be the holding display name.voidsetHoldingFeaturesToBeDecoded(String[] aHoldingFeaturesToBeDecoded) Specifies the features that should be decoded into the holding objects of the model that will be returned by thedecodemethod.voidsetWaypointsModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aWaypointsModel) Specifies a waypoint model.Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFSingleModelDecoder
cleanUp, setKeyFeatureNamesMethods 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, transformPointToReferenceDatumSFCTMethods 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
-
TLcdDAFIFHoldingDecoder
Deprecated.Constructs a newTLcdDAFIFHoldingDecoderobject. The user should specify which domainFactory he or she wants to use to create the holdings.- Parameters:
aFactory- the factory to be used to create the holdings
-
TLcdDAFIFHoldingDecoder
Constructs a newTLcdDAFIFHoldingDecoderobject. The user should specify which factory he or she wants to use to create the holdings.- Parameters:
aFactory- the factory to be used to create the holdings
-
TLcdDAFIFHoldingDecoder
@Deprecated public TLcdDAFIFHoldingDecoder(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties) Deprecated.Constructs a newTLcdDAFIFHoldingDecoderobject.- Parameters:
aDomainFactory- the factory to be used to create the holdingsaDAFIFProperties- aPropertiesobject that contains for each domain object the appropriate file name
-
TLcdDAFIFHoldingDecoder
Constructs a newTLcdDAFIFHoldingDecoderobject.- Parameters:
aFactory- the factory to be used to create the holdingsaDAFIFProperties- aPropertiesobject that contains for each domain object the appropriate file name
-
-
Method Details
-
decode
Calls the decode method ofALcdDAFIFSingleModelDecoder.Checks whether a waypoint model is set before starting the decode process. If no waypoint model is specified, an
IllegalStateExceptionobject will be thrown.- Specified by:
decodein interfaceILcdModelDecoder- Overrides:
decodein 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) or a .toc file containing the DAFIF properties (the data file should be in the same directory as the .toc file)- Returns:
- the model build by reading the file found with aSource
- Throws:
IOException- if an error occurs during the reading process- See Also:
-
handleRecord
protected final void handleRecord(int aFormat, char[] aRecord) Description copied from class:ALcdDAFIFSingleModelDecoderDeals with one record of input.- Specified by:
handleRecordin classALcdDAFIFSingleModelDecoder- Parameters:
aFormat- the format of the recordaRecord- the record
-
createModelDescriptor
Description copied from class:ALcdDAFIFSingleModelDecoderCreates and returns the model descriptor to be set on the model returned in thedecodemethod.- Specified by:
createModelDescriptorin 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
-
getDecodeFileName
Description copied from interface:ILcdDAFIFDecoderReturns 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:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Overrides:
getDisplayNamein classALcdDAFIFDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
createModelBuilderSupport
protected com.luciad.format.dafif.decoder.ILcdModelBuilderSupport createModelBuilderSupport() -
setHoldingDefaultDisplayNameIndex
public void setHoldingDefaultDisplayNameIndex(int aIndex) Specifies the index of the feature to be the holding display name.- Parameters:
aIndex- the index of the feature to be used as display name
-
setWaypointsModel
Specifies a waypoint model.Please make sure there 's a unique index on this model!
- Parameters:
aWaypointsModel- the waypoint model to be used to create the holding patterns- See Also:
-
createRequiredIndex
Adds a unique index on specified model of waypoints.This method should be called before calling
setWaypointsModelmethod.Please make sure that the following features were decoded into the model objects of the specified waypoint model:
- ILcdWayPointFeature.IDENTIFIER,
- ILcdDAFIFWayPointFeature.COUNTRY_CODE.
- Parameters:
aModel- a model containing waypoints- See Also:
-
setHoldingFeaturesToBeDecoded
Specifies the features that should be decoded into the holding objects of the model that will be returned by thedecodemethod.Please make sure that the
ILcdDAFIFHoldingFeature.WAYPOINT_IDENTIFIERandILcdDAFIFHoldingFeature.WAYPOINT_COUNTRY_CODEfeatures are in your list.- Parameters:
aHoldingFeaturesToBeDecoded- a list of features that should be decoded into the holding objects
-