Class ALcdDAFIFSingleModelDecoder

java.lang.Object
com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
com.luciad.format.dafif.decoder.ALcdDAFIFSingleModelDecoder
All Implemented Interfaces:
ILcdDAFIFDecoder, ILcdInputStreamFactoryCapable, ILcdModelDecoder
Direct Known Subclasses:
ALcdDAFIFAerodromeDecoder, ALcdDAFIFAirspaceDecoder, TLcdDAFIFATSRouteDecoder, TLcdDAFIFHelipadDecoder, TLcdDAFIFHoldingDecoder, TLcdDAFIFMilitaryTrainingRouteDecoder, TLcdDAFIFOrtcaDecoder, TLcdDAFIFParachuteJumpAreaDecoder, TLcdDAFIFProcedureDecoder, TLcdDAFIFRunwayDecoder, TLcdDAFIFWayPointDecoder

public abstract class ALcdDAFIFSingleModelDecoder extends ALcdDAFIFDecoder
This abstract extension of the ALcdDAFIFDecoder class defines the skeleton of the decode algorithm used to decode DAFIF data files.

The decode method will loop through all records in the source file. A concrete decoder can decide on what to do with each record by implementing the handleRecord method.

Extensions of the ALcdDAFIFSingleModelDecoder class will decode so-called "single" model. Such a model has no submodels, as opposed to the "multi" model.

  • Constructor Details

    • ALcdDAFIFSingleModelDecoder

      public ALcdDAFIFSingleModelDecoder(Properties aDAFIFProperties)
      Initializes the DAFIFProperties field with the specified properties object. This object may be null.

      If you don't have a properties object here, you can still specify it by decoding a .toc file containing the DAFIF properties. The decoder will read the properties from the .toc file and look for the data file to be decoded in the directory containing this .toc file.

      Parameters:
      aDAFIFProperties - a Properties object containing for each domain object the name of its data file or NULL
  • Method Details

    • decode

      public ILcdModel decode(String aSource) throws IOException
      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.

      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:
    • cleanUp

      protected void cleanUp()
      Description copied from class: ALcdDAFIFDecoder
      This method should be implemented by a concrete class.

      It should empty all temporary data structures used during the decoding process.

      Specified by:
      cleanUp in class ALcdDAFIFDecoder
    • handleRecord

      protected abstract void handleRecord(int aFormat, char[] aRecord)
      Deals with one record of input.
      Parameters:
      aFormat - the format of the record
      aRecord - the record
    • createModelDescriptor

      protected abstract ILcdModelDescriptor createModelDescriptor(String aSource)
      Creates and returns the model descriptor to be set on the model returned in the decode method.
      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
    • setKeyFeatureNames

      public void setKeyFeatureNames(String[] aKeyFeatureNames)
      Specifies an Array object containing the names of the features that will be used as a key to insert objects into the model.

      Please retrieve these feature names from the feature interfaces corresponding with the domain objects (e.g. com.luciad.ais.model.aerodrome.ILcdAerodromeFeature).

      Parameters:
      aKeyFeatureNames - an Array object containing the names of the features that will be used as a key to insert objects into the model