public class TLcdDAFIFHoldingDecoder extends ALcdDAFIFSingleModelDecoder
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)
.
DAFIF_PROP_EXTENSION, fRecordCount
Constructor and Description |
---|
TLcdDAFIFHoldingDecoder(ALcdAISObjectFactory aFactory)
Deprecated.
|
TLcdDAFIFHoldingDecoder(ALcdAISObjectFactory aDomainFactory,
Properties aDAFIFProperties)
Deprecated.
|
TLcdDAFIFHoldingDecoder(TLcdAISDataObjectFactory aFactory)
Constructs a new
TLcdDAFIFHoldingDecoder object. |
TLcdDAFIFHoldingDecoder(TLcdAISDataObjectFactory aFactory,
Properties aDAFIFProperties)
Constructs a new
TLcdDAFIFHoldingDecoder object. |
Modifier and Type | Method and Description |
---|---|
protected com.luciad.format.dafif.decoder.ILcdModelBuilderSupport |
createModelBuilderSupport()
Creates and returns the support class that will take care of putting
the objects into the model that will be returned in the decode method.
|
protected ILcdModelDescriptor |
createModelDescriptor(String aSource)
Creates and returns the model descriptor to be set on the model returned in the
decode method. |
void |
createRequiredIndex(ILcdFeatureIndexedAnd2DBoundsIndexedModel aModel)
Adds a unique index on specified model of waypoints.
|
ILcdModel |
decode(String aSource)
Calls the decode method of
ALcdDAFIFSingleModelDecoder . |
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 |
setHoldingDefaultDisplayNameIndex(int aIndex)
Specifies the index of the feature to be the
holding display name.
|
void |
setHoldingFeaturesToBeDecoded(String[] aHoldingFeaturesToBeDecoded)
Specifies the features that should be decoded into the holding objects
of the model that will be returned by the
decode method. |
void |
setWaypointsModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aWaypointsModel)
Specifies a waypoint model.
|
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 TLcdDAFIFHoldingDecoder(ALcdAISObjectFactory aFactory)
TLcdDAFIFHoldingDecoder
object. The user
should specify which domainFactory he or she wants to use to create the holdings.aFactory
- the factory to be used to create the holdingspublic TLcdDAFIFHoldingDecoder(TLcdAISDataObjectFactory aFactory)
TLcdDAFIFHoldingDecoder
object. The user
should specify which factory he or she wants to use to create the holdings.aFactory
- the factory to be used to create the holdings@Deprecated public TLcdDAFIFHoldingDecoder(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties)
TLcdDAFIFHoldingDecoder
object.aDomainFactory
- the factory to be used to create the holdingsaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic TLcdDAFIFHoldingDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
TLcdDAFIFHoldingDecoder
object.aFactory
- the factory to be used to create the holdingsaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic ILcdModel decode(String aSource) throws IOException
ALcdDAFIFSingleModelDecoder
.
Checks whether a waypoint model is set before starting the decode process.
If no waypoint model is specified, an IllegalStateException
object
will be thrown.
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) or a .toc file
containing the DAFIF properties (the data file should be in the same directory as the .toc file)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 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 String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
getDisplayName
in class ALcdDAFIFDecoder
ILcdModelDecoder
.protected com.luciad.format.dafif.decoder.ILcdModelBuilderSupport createModelBuilderSupport()
ALcdDAFIFDecoder
ILcdModelBuilderSupport
interface
that will be used to maintain the model during the decoding processpublic void setHoldingDefaultDisplayNameIndex(int aIndex)
aIndex
- the index of the feature to be used as display namepublic void setWaypointsModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aWaypointsModel)
Please make sure there 's a unique index on this model!
aWaypointsModel
- the waypoint model to be used to create the holding patternscreateRequiredIndex(com.luciad.model.ILcdFeatureIndexedAnd2DBoundsIndexedModel)
public void createRequiredIndex(ILcdFeatureIndexedAnd2DBoundsIndexedModel aModel)
This method should be called before calling setWaypointsModel
method.
Please make sure that the following features were decoded into the model objects of the specified waypoint model:
aModel
- a model containing waypointssetWaypointsModel(com.luciad.model.ILcdFeatureIndexedAnd2DBoundsIndexedModel)
public void setHoldingFeaturesToBeDecoded(String[] aHoldingFeaturesToBeDecoded)
decode
method.
Please make sure that the ILcdDAFIFHoldingFeature.WAYPOINT_IDENTIFIER
and
ILcdDAFIFHoldingFeature.WAYPOINT_COUNTRY_CODE
features are in your list.
aHoldingFeaturesToBeDecoded
- a list of features that should be decoded into the holding objects