Class TLcdDAFIFMilitaryTrainingRouteDecoder

All Implemented Interfaces:
ILcdDAFIFDecoder, ILcdInputStreamFactoryCapable, ILcdModelDecoder

public class TLcdDAFIFMilitaryTrainingRouteDecoder extends ALcdDAFIFSingleModelDecoder
This extension of the ALcdDAFIFSingleModelDecoder decodes military training routes from a DAFIF source file. Decoded models have as model descriptor an instance of TLcdDAFIFMilitaryTrainingRouteModelDescriptor.

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.MilitaryTrainingRoute, which can also be retrieved through ILcdDataObject.getDataType(). The available properties of the objects are defined in TLcdDAFIFMilitaryTrainingRouteDataProperties. 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 setRouteFeaturesToBeDecoded method, the setRouteSegmentFeaturesToBeDecoded method and setRoutePointFeaturesToBeDecoded method allow the user to specify which DAFIF features are decoded into the featured model objects.

If no features to be decoded are specified, all features will be decoded.

The following fields (taken from the National Imagery and Mapping Agency (NIMA) Product Specifications for Digital Aeronautical Flight Information File (DAFIF), Seventh Edition, May 2001) are supported by the decoder. The list indicates into which feature the fields are decoded.

  • IDENTIFIER: ILcdDAFIFMilitaryTrainingRouteFeature.IDENTIFIER
  • POINT IDENT: ILcdDAFIFMilitaryTrainingRoutePointFeature.POINT_IDENTIFIER
  • NEXT POINT IDENT: ILcdDAFIFMilitaryTrainingRoutePointFeature.NEXT_POINT_IDENTIFIER
  • ALTITUDE DESCRIPTION: ILcdDAFIFMilitaryTrainingRoutePointFeature.CROSS_ALTITUDE_DESCRIPTION, ILcdDAFIFMilitaryTrainingRoutePointFeature.ENROUTE_ALTITUDE_DESCRIPTION
  • CROSS ALTITUDE ONE: ILcdDAFIFMilitaryTrainingRoutePointFeature.CROSS_ALTITUDE_1, ILcdDAFIFMilitaryTrainingRoutePointFeature.CROSS_ALTITUDE_1_UNIT
  • CROSS ALTITUDE TWO: ILcdDAFIFMilitaryTrainingRoutePointFeature.CROSS_ALTITUDE_2, ILcdDAFIFMilitaryTrainingRoutePointFeature.CROSS_ALTITUDE_2_UNIT
  • ENROUTE ALTITUDE ONE: ILcdDAFIFMilitaryTrainingRoutePointFeature.ENROUTE_ALTITUDE_1, ILcdDAFIFMilitaryTrainingRoutePointFeature.ENROUTE_ALTITUDE_1_UNIT
  • ENROUTE ALTITUDE TWO: ILcdDAFIFMilitaryTrainingRoutePointFeature.ENROUTE_ALTITUDE_2, ILcdDAFIFMilitaryTrainingRoutePointFeature.ENROUTE_ALTITUDE_2_UNIT
  • WIDTH: ILcdDAFIFMilitaryTrainingRoutePointFeature.WIDTH_LEFT, ILcdDAFIFMilitaryTrainingRoutePointFeature.WIDTH_RIGHT
  • USAGE CODE: ILcdDAFIFMilitaryTrainingRoutePointFeature.USAGE_CODE
  • TURN RADIUS: ILcdDAFIFMilitaryTrainingRoutePointFeature.TURN_RADIUS, ILcdDAFIFMilitaryTrainingRoutePointFeature.TURN_RADIUS_UNIT
  • TURN DIRECTION: ILcdDAFIFMilitaryTrainingRoutePointFeature.TURN_DIRECTION
  • ADDITIONAL ROUTE INFO: ILcdDAFIFMilitaryTrainingRoutePointFeature.ADDITIONAL_ROUTE_INFO
  • BI-SECTION OF PATH ANGLE: ILcdDAFIFMilitaryTrainingRouteSegmentFeature.BI_SECTION_1, ILcdDAFIFMilitaryTrainingRouteSegmentFeature.BI_SECTION_2
  • FIX: ILcdDAFIFMilitaryTrainingRoutePointFeature.FIX

DAFIF decoders rely on a specific set of key features that uniquely define an object. This set of features must always be included in the set of features to be decoded. For military training routes the key features are:

See Also:
  • Constructor Details

    • TLcdDAFIFMilitaryTrainingRouteDecoder

      @Deprecated public TLcdDAFIFMilitaryTrainingRouteDecoder(ALcdAISObjectFactory aDomainFactory)
      Deprecated.
      Creates a new TLcdDAFIFMilitaryTrainingRouteDecoder. The user should specify which domainFactory he or she wants to use to create the military training routes.
      Parameters:
      aDomainFactory - the factory to be used to create the model objects
    • TLcdDAFIFMilitaryTrainingRouteDecoder

      public TLcdDAFIFMilitaryTrainingRouteDecoder(TLcdAISDataObjectFactory aFactory)
      Creates a new TLcdDAFIFMilitaryTrainingRouteDecoder. The user should specify which factory he or she wants to use to create the military training routes.
      Parameters:
      aFactory - the factory to be used to create the model objects
    • TLcdDAFIFMilitaryTrainingRouteDecoder

      @Deprecated public TLcdDAFIFMilitaryTrainingRouteDecoder(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties)
      Deprecated.
      Creates a new TLcdDAFIFMilitaryTrainingRouteDecoder. The user should specify which domainFactory he or she wants to use to create the military training routes.
      Parameters:
      aDomainFactory - the factory to be used to create the model objects
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
    • TLcdDAFIFMilitaryTrainingRouteDecoder

      public TLcdDAFIFMilitaryTrainingRouteDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
      Creates a new TLcdDAFIFMilitaryTrainingRouteDecoder. The user should specify which domainFactory he or she wants to use to create the military training routes.
      Parameters:
      aFactory - the factory to be used to create the model objects
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Overrides:
      getDisplayName in class ALcdDAFIFDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • getDecodeFileName

      public String 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
    • decode

      public ILcdModel decode(String aSource) throws IOException
      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 interface ILcdModelDecoder
      Overrides:
      decode in class ALcdDAFIFSingleModelDecoder
      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 (see getDecodeFileName()).
      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: ALcdDAFIFSingleModelDecoder
      Deals with one record of input.
      Specified by:
      handleRecord in class ALcdDAFIFSingleModelDecoder
      Parameters:
      aFormat - the format of the record
      aRecord - the record
    • createModelDescriptor

      protected ILcdModelDescriptor createModelDescriptor(String aSource)
      Description copied from class: ALcdDAFIFSingleModelDecoder
      Creates and returns the model descriptor to be set on the model returned in the decode method.
      Specified by:
      createModelDescriptor in class ALcdDAFIFSingleModelDecoder
      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
    • setRouteDefaultDisplayNameIndex

      public void setRouteDefaultDisplayNameIndex(int aIndex)
      Specifies the index of the feature to be the route display name.
      Parameters:
      aIndex - the index of the feature to be used as display name
    • setRoutePointDefaultDisplayNameIndex

      public void setRoutePointDefaultDisplayNameIndex(int aIndex)
      Specifies the index of the feature to be the route point display name.
      Parameters:
      aIndex - the index of the feature to be used as display name
    • setRouteFeaturesToBeDecoded

      public void setRouteFeaturesToBeDecoded(String[] aRouteFeaturesToBeDecoded)
      Specifies a list of features to be decoded into the military training route model objects.

      Please make sure that the IDENTIFIER feature is in your list of features to be decoded!

      Parameters:
      aRouteFeaturesToBeDecoded - a list of features that should be decoded into the route objects
    • setRouteSegmentFeaturesToBeDecoded

      public void setRouteSegmentFeaturesToBeDecoded(String[] aRouteSegmentFeaturesToBeDecoded)
      Specifies a list of features to be decoded into the military training route segments.
      Parameters:
      aRouteSegmentFeaturesToBeDecoded - a list of features that should be decoded into the route segment objects
    • setRoutePointFeaturesToBeDecoded

      public void setRoutePointFeaturesToBeDecoded(String[] aRoutePointFeaturesToBeDecoded)
      Specifies a list of features to be decoded into the military training route points.
      Parameters:
      aRoutePointFeaturesToBeDecoded - a list of features that should be decoded into the route point objects