public class TLcdDAFIFTSpecialUseAirspaceDecoder extends ALcdDAFIFTModelDecoder implements ILcdDAFIFSubTypeFilteringDecoder
ILcdModelDecoder
that decodes DAFIFT special use airspace
objects from the specified source directory. The decoded models have as model descriptor
an instance of TLcdDAFIFSpecialUseAirspaceModelDescriptor
. If subtype filtering
is enabled (via setSubTypesToDecode(int[])
), the decoder will produce a
TLcdModelList
with a TLcdDAFIFSpecialUseAirspaceModelListDescriptor
.
Each element of this model list will contain objects of one of the selected subtypes.
The number of models in the list, in other words, will equal the number of chosen
subtypes.
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 TLcdDAFIFTDataTypes.SpecialUseAirspace
,
which can also be retrieved through ILcdDataObject.getDataType()
.
The available properties of the objects are defined in TLcdDAFIFTSpecialUseAirspaceDataProperties
.
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 setAirspaceFeaturesToBeDecoded
method allows the
user to specify which DAFIFT features are to be decoded into the featured model objects. If
no features are specified, all features will be decoded.
ILcdDAFIFAirspaceFeature.BOUNDARY_IDENTIFICATION
ILcdDAFIFAirspaceFeature.SECTOR
ILcdAirspaceFeature.NAME
ILcdDAFIFAirspaceFeature.ICAO_CODE
,
ILcdDAFIFAirspaceFeature.ICAO_REGION
ILcdDAFIFAirspaceFeature.CONTROLLING_AGENCY
ILcdDAFIFAirspaceFeature.COMMUNICATIONS_NAME
ILcdDAFIFAirspaceFeature.COMMUNICATIONS_FREQUENCY1
ILcdDAFIFAirspaceFeature.COMMUNICATIONS_FREQUENCY2
ILcdDAFIFAirspaceFeature.LEVEL
ILcdAirspaceFeature.UPPER_LIMIT
,
ILcdAirspaceFeature.UPPER_LIMIT_UNIT
,
ILcdAirspaceFeature.UPPER_LIMIT_REFERENCE
ILcdAirspaceFeature.LOWER_LIMIT
,
ILcdAirspaceFeature.LOWER_LIMIT_UNIT
,
ILcdAirspaceFeature.LOWER_LIMIT_REFERENCE
ILcdDAFIFAirspaceFeature.EFFECTIVE_TIMES
ILcdDAFIFAirspaceFeature.WEATHER
ILcdDAFIFAirspaceFeature.EFFECTIVE_DATE
ILcdDAFIFAirspaceFeature.CYCLE_DATE
ILcdDAFIFAirspaceFeature
,
TLcdDAFIFSpecialUseAirspaceModelDescriptor
Constructor and Description |
---|
TLcdDAFIFTSpecialUseAirspaceDecoder(ALcdAISObjectFactory aDomainFactory)
Deprecated.
|
TLcdDAFIFTSpecialUseAirspaceDecoder(TLcdAISDataObjectFactory aFactory)
Constructs a new
TLcdDAFIFTSpecialUseAirspaceDecoder 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 aSourceName)
Decode the given source and return a TLcdModelList with a submodel per decoded subtype.
|
Object[] |
getAvailableSubTypes()
Get an array of enumerated values defining all subtypes of a given DAFIF feature type.
|
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.
|
int[] |
getSubTypesToDecode()
Returns the set of special use airspace types to be decoded.
|
String[] |
getUniqueKeyFeatureNames()
Returns the array of
String objects containing the names of the features
that will be used as a unique key to insert objects into the model. |
void |
setAirspaceDefaultDisplayNameIndex(int aIndex)
Specifies the index of the feature to be the airspace display name.
|
void |
setAirspaceFeaturesToBeDecoded(String[] aFeaturesToBeDecoded)
Specifies the airspace features to be decoded into the model objects.
|
void |
setAirspaceTypeToFilter(TLcdAirspaceType aAirspaceTypeToFilter)
Sets the airspace type to be filtered on.
|
void |
setDataObjectFactory(TLcdAISDataObjectFactory aFactory)
Specifies the data factory.
|
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 |
setModelFilter(ILcdDAFIFModelFilter aFilter)
Set the model filter of this decoder.
|
void |
setRecordFilter(ILcdDAFIFTRecordFilter aRecordFilter)
Specifies a filter to be used while creating the model.
|
void |
setSubTypesToDecode(int[] aSubTypeIndices)
Set the set of special use airspace types to be decoded.
|
getDecodingBounds, getModelFilter, setDecodingBounds
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
@Deprecated public TLcdDAFIFTSpecialUseAirspaceDecoder(ALcdAISObjectFactory aDomainFactory)
TLcdDAFIFTSpecialUseAirspaceDecoder
object. The user should specify which
aDomainFactory he or she wants to use to create the special use airspaces.aDomainFactory
- The factory to be used to create the model objects.public TLcdDAFIFTSpecialUseAirspaceDecoder(TLcdAISDataObjectFactory aFactory)
TLcdDAFIFTSpecialUseAirspaceDecoder
object. The user should specify which
aDomainFactory he or she wants to use to create the special use airspaces.aFactory
- The factory to be used to create the model objects.public Object[] getAvailableSubTypes()
setSubTypesToDecode(int[])
.getAvailableSubTypes
in interface ILcdDAFIFSubTypeFilteringDecoder
public void setSubTypesToDecode(int[] aSubTypeIndices)
setSubTypesToDecode
in interface ILcdDAFIFSubTypeFilteringDecoder
aSubTypeIndices
- an array of indices specifying which type of airspace
will be decoded. If null
is passed, reset to the default types.public int[] getSubTypesToDecode()
getSubTypesToDecode
in interface ILcdDAFIFSubTypeFilteringDecoder
public void setAirspaceTypeToFilter(TLcdAirspaceType aAirspaceTypeToFilter)
decode
method will only put airspaces of the chosen type in the decoded model.
If aAirspaceTypeToFilter is null
, the decode method will put all airspaces in
the model.aAirspaceTypeToFilter
- The airspace type to be filtered on.public void setModelFilter(ILcdDAFIFModelFilter aFilter)
setModelFilter
in class ALcdDAFIFTModelDecoder
aFilter
- The model filter that should be passed before a model object
is added to the resulting model.ALcdDAFIFTModelDecoder.getModelFilter()
public ILcdModel decode(String aSourceName) throws IOException
decode
in interface ILcdModelDecoder
aSourceName
- a DAFIF edition 8 source nameIOException
- if the decoding cannot complete.ILcdModelDecoder.canDecodeSource(String)
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
getDisplayName
in class ALcdDAFIFTModelDecoder
ILcdModelDecoder
.public void setAirspaceFeaturesToBeDecoded(String[] aFeaturesToBeDecoded)
BOUNDARY_IDENTIFICATION
and SECTOR
features to your list. These features
corresponds to the unique key feature name of an airspace model object.
If you want to filter on an airspace type, you should also include the airspace feature
ILcdAirspaceFeature.TYPE
into your list.aFeaturesToBeDecoded
- A list of features that should be decoded into the special use airspace model objects.public void setAirspaceDefaultDisplayNameIndex(int aIndex)
aIndex
- The index of the feature to be the airspace display name.public String[] getUniqueKeyFeatureNames()
String
objects containing the names of the features
that will be used as a unique key to insert objects into the model.String
objects containing the names of the features
that will be used as a unique key to insert objects into the model.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.