public class TLcdDAFIFTAerodromeNavaidDecoder extends ALcdDAFIFTModelDecoder
ILcdModelDecoder
that decodes DAFIFT navaid objects (VOR, DME, NDB,
TACAN, VOR-DME, VORTAC and NDB-DME) from the specified source directory. The decoded models have
as model descriptor an instance of TLcdDAFIFAerodromeNavaidModelListDescriptor
. This
model list descriptor contains instances of the descriptor TLcdDAFIFDMEModelDescriptor
,
TLcdDAFIFVORModelDescriptor
, TLcdDAFIFNDBModelDescriptor
and/or
TLcdDAFIFTACANModelDescriptor
, dependent of the source directory.
The navaid objects produced by this decoder are a subset from the collection of navaids decoded by
the TLcdDAFIFTNavaidDecoder
. To be in the subset, a navaid
should:
TLcdDAFIFTAerodromeNavaidDecoder
won't create navaids itself. It will retrieve the
navaids for its model from the specified navaid model. This navaid model should be set by using the
setNavaidModel
method. The model should have an index on some key features
that uniquely define the objects. For navaids the key features are:
A unique key with the features mentioned above is added on the aerodrome navaid model. The features
should be decoded into the featured model objects of the aerodrome navaid model.Constructor and Description |
---|
TLcdDAFIFTAerodromeNavaidDecoder(ALcdAISObjectFactory aDomainFactory)
Deprecated.
|
TLcdDAFIFTAerodromeNavaidDecoder(TLcdAISDataObjectFactory aFactory)
Constructs a new
TLcdDAFIFTAerodromeNavaidDecoder object. |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aSource)
Returns
true if the specified source is:
A file with the specific name corresponding to the object type of this decoder
A directory containing such a file
A .toc file in a directory, pointing to such a file
|
ILcdModel |
decode(String aSource)
Checks whether a navaid model is set before starting the decode process.
|
TLcdAISDataObjectFactory |
getDataObjectFactory()
Returns the factory that is used to create domain objects.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
ALcdAISObjectFactory |
getDomainFactory()
Deprecated.
|
String |
getErrorMessage()
Returns the error message of the last decode call.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is currently used for creating
the input streams for the given source names.
|
int |
getMaxNumberOfErrorReports()
Returns the number of error reports to be added to the error message.
|
ILcdDAFIFTRecordFilter |
getRecordFilter()
Returns the record filter that is currently used.
|
String[] |
getUniqueKeyFeatureNames(int aIndex)
Returns for the given submodel the array of
String objects containing the names
of the features that will be used as a unique key to insert objects into the submodel. |
void |
setDataObjectFactory(TLcdAISDataObjectFactory aFactory)
Specifies the data factory.
|
void |
setDMEDefaultDisplayNameIndex(int aIndex)
Specifies the index of the feature to be the DME display name.
|
void |
setDomainFactory(ALcdAISObjectFactory aDomainFactory)
Deprecated.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory that will be used for creating the
input streams for the given source names.
|
void |
setMaxNumberOfErrorReports(int aMaxNumberOfErrorReports)
Specifies a value for the maximum number of error reports.
|
void |
setNavaidModel(TLcdModelList aNavaidModel)
Specifies the model list containing the navaid objects this decoder should use.
|
void |
setNDBDefaultDisplayNameIndex(int aIndex)
Specifies the index of the feature to be the NDB display name.
|
void |
setRecordFilter(ILcdDAFIFTRecordFilter aRecordFilter)
Specifies a filter to be used while creating the model.
|
void |
setTACANDefaultDisplayNameIndex(int aIndex)
Specifies the index of the feature to be the TACAN display name.
|
void |
setVORDefaultDisplayNameIndex(int aIndex)
Specifies the index of the feature to be the VOR display name.
|
getDecodingBounds, getModelFilter, setDecodingBounds, setModelFilter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
@Deprecated public TLcdDAFIFTAerodromeNavaidDecoder(ALcdAISObjectFactory aDomainFactory)
TLcdDAFIFTAerodromeNavaidDecoder
object. The aDomainFactory
specified here, may be null
.aDomainFactory
- The factory to be used to create the model objects.public TLcdDAFIFTAerodromeNavaidDecoder(TLcdAISDataObjectFactory aFactory)
TLcdDAFIFTAerodromeNavaidDecoder
object. The factory
specified here, may be null
.aFactory
- The factory to be used to create the model objects.public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
getDisplayName
in class ALcdDAFIFTModelDecoder
ILcdModelDecoder
.public ILcdModel decode(String aSource) throws IOException
IllegalStateException
object will be thrown.
Returns a model list containing one or more submodels. Each submodel contains domain objects
of the same type.
The models will be build by looping through the records found in the source file. Each record
that passes the record filter (getRecordFilter()
) will be decoded.
A decoded record needs to pass two additional filters (a model filter getModelFilter()
and a bounds filter getDecodingBounds()
) before
it can be added to the model.
Furthermore, an error message will be initialized and filled with reports about errors occurred
during the decode process. By default, all reports will be added into the error message. The
method setMaxNumberOfErrorReports(int)
can be used to adjust this setting.decode
in interface ILcdModelDecoder
aSource
- Either the directory containing the DAFIFT source file to decode
or the DAFIFT source file itself.IOException
- if an error occurs during the reading process.IllegalStateException
- if no navaid model has been specified.ILcdModelDecoder.canDecodeSource(String)
public void setVORDefaultDisplayNameIndex(int aIndex)
aIndex
- The index of the feature to be the VOR display name.public void setNDBDefaultDisplayNameIndex(int aIndex)
aIndex
- The index of the feature to be the NDB display name.public void setDMEDefaultDisplayNameIndex(int aIndex)
aIndex
- The index of the feature to be the DME display name.public void setTACANDefaultDisplayNameIndex(int aIndex)
aIndex
- The index of the feature to be the TACAN display name.public void setNavaidModel(TLcdModelList aNavaidModel)
aNavaidModel
- A model list containing navaid objects.public String[] getUniqueKeyFeatureNames(int aIndex)
String
objects containing the names
of the features that will be used as a unique key to insert objects into the submodel.aIndex
- The index of the submodel whose unique key feature names are being retrieved.public boolean canDecodeSource(String aSource)
true
if the specified source is:
.toc
file in a directory, pointing to such a fileaSource
- the name of the source file or directory that you want to decode@Deprecated public ALcdAISObjectFactory getDomainFactory()
getDataObjectFactory()
setDomainFactory(ALcdAISObjectFactory)
@Deprecated public void setDomainFactory(ALcdAISObjectFactory aDomainFactory)
setDataObjectFactory(TLcdAISDataObjectFactory)
aDomainFactory
- The factory that will be used to create domain objects.getDomainFactory()
public TLcdAISDataObjectFactory getDataObjectFactory()
setDomainFactory(ALcdAISObjectFactory)
public void setDataObjectFactory(TLcdAISDataObjectFactory aFactory)
null
, will
NOT use their associated domain factory (see getDomainFactory()
).aFactory
- The factory that will be used to create domain objects.getDomainFactory()
public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
setInputStreamFactory(ILcdInputStreamFactory)
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- The input stream factory to be used.getInputStreamFactory()
public ILcdDAFIFTRecordFilter getRecordFilter()
setRecordFilter(ILcdDAFIFTRecordFilter)
public void setRecordFilter(ILcdDAFIFTRecordFilter aRecordFilter)
aRecordFilter
- The record filter that should be passed before a record
can be decoded.getRecordFilter()
public int getMaxNumberOfErrorReports()
setMaxNumberOfErrorReports(int)
public void setMaxNumberOfErrorReports(int aMaxNumberOfErrorReports)
aMaxNumberOfErrorReports
- The maximum number of error reports to be added to the error message.getMaxNumberOfErrorReports()
public String getErrorMessage()
String
object containing the errors occurred during
the last decode process.