Class TLcdDAFIFAerodromeNavaidDecoder

All Implemented Interfaces:
ILcdDAFIFDecoder, ILcdDAFIFMultiModelDecoder, ILcdInputStreamFactoryCapable, ILcdModelDecoder
Direct Known Subclasses:
TLcdDAFIFIndependentAerodromeNavaidDecoder

public class TLcdDAFIFAerodromeNavaidDecoder extends ALcdDAFIFMultiModelDecoder
This extension of the ALcdDAFIFMultiModelDecoder decodes navaids (VOR, DME, NDB, TACAN, VOR-DME, VORTAC and NDB-DME) from a DAFIF source file. Decoded models have as model descriptor an instance of TLcdDAFIFAerodromeNavaidModelListDescriptor. This descriptor contains instances of TLcdDAFIFDMEModelDescriptor, TLcdDAFIFVORModelDescriptor, TLcdDAFIFNDBModelDescriptor and/or TLcdDAFIFTACANModelDescriptor, dependent of the source file.

The navaids produced by this decoder are a subset from the collection of navaids decoded by the TLcdDAFIFNavaidDecoder. To be in the subset, a navaid should:

  • have the same name as the airport or heliport it belongs to,
  • be located on the airport or heliport it belongs to (and have a different name),
  • be used to furnish final approach procedure guidance on a IAP serving the airport or heliport it belongs to.

The TLcdDAFIFAerodromeNavaidDecoder won't create navaids itself. It will retrieve the navaids for its model from a navaid model.

A navaid model should be set by using the setNavaidModel method. This model should have an index on some key features that uniquely define the objects. For navaids the key features are:

To add the right key on the navaid model, use the createRequiredIndices method. The features mentioned above should be decoded into the featured model objects of the navaid model.
See Also:
  • Constructor Details

    • TLcdDAFIFAerodromeNavaidDecoder

      @Deprecated public TLcdDAFIFAerodromeNavaidDecoder(ALcdAISObjectFactory aFactory)
      Deprecated.
      Constructs a new TLcdDAFIFAerodromeNavaidDecoder object. The domainFactory specified here, may be null.
      Parameters:
      aFactory - a domainFactory that won't be used.
      See Also:
    • TLcdDAFIFAerodromeNavaidDecoder

      public TLcdDAFIFAerodromeNavaidDecoder(TLcdAISDataObjectFactory aFactory)
      Constructs a new TLcdDAFIFAerodromeNavaidDecoder object. The domainFactory specified here, may be null.
      Parameters:
      aFactory - a domainFactory that won't be used.
      See Also:
    • TLcdDAFIFAerodromeNavaidDecoder

      @Deprecated public TLcdDAFIFAerodromeNavaidDecoder(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties)
      Deprecated.
      Constructs a new TLcdDAFIFAerodromeNavaidDecoder object.
      Parameters:
      aFactory - a domainFactory that won't be used.
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
      See Also:
    • TLcdDAFIFAerodromeNavaidDecoder

      public TLcdDAFIFAerodromeNavaidDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
      Constructs a new TLcdDAFIFAerodromeNavaidDecoder object.
      Parameters:
      aFactory - a domainFactory that won't be used.
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
      See Also:
  • 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
      Calls the decode method of ALcdDAFIFMultiModelDecoder.

      Checks whether a navaid model is set before starting the decode process. If no navaid model is specified, an IllegalStateException object will be thrown.

      Specified by:
      decode in interface ILcdModelDecoder
      Overrides:
      decode in class ALcdDAFIFMultiModelDecoder
      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) or a .toc file containing the DAFIF properties (the data file should be in the same directory as the .toc file)
      Returns:
      the model build by reading the file found with aSource
      Throws:
      IOException - if an error occurs during the reading process
      IllegalStateException - if no navaid model has been specified
      See Also:
    • handleRecord

      protected final void handleRecord(int aFormat, char[] aRecord)
      Description copied from class: ALcdDAFIFMultiModelDecoder
      Deals with one record of input.
      Specified by:
      handleRecord in class ALcdDAFIFMultiModelDecoder
      Parameters:
      aFormat - the format of the record
      aRecord - the record to deal with
    • createModelDescriptor

      protected ILcdModelDescriptor createModelDescriptor(int aIndex, String aSource)
      Description copied from class: ALcdDAFIFMultiModelDecoder
      Creates and returns the model descriptor to be set on the model with index aIndex in the model (i.e. in the model returned in the decode method).
      Specified by:
      createModelDescriptor in class ALcdDAFIFMultiModelDecoder
      Parameters:
      aSource - the source to be decoded
      Returns:
      a model descriptor describing the data in the submodel at position aIndex in the model produced by this decoder
    • createModelDescriptor

      public TLcdEditableModelListDescriptor createModelDescriptor(String aSource)
      Description copied from interface: ILcdDAFIFMultiModelDecoder
      Creates and returns the model descriptor to be set on the model returned in the decode method.
      Specified by:
      createModelDescriptor in interface ILcdDAFIFMultiModelDecoder
      Specified by:
      createModelDescriptor in class ALcdDAFIFMultiModelDecoder
      Parameters:
      aSource - the source that will be used to build the model
      Returns:
      the model descriptor to be set on the model produced by this decoder
    • setVORDefaultDisplayNameIndex

      public void setVORDefaultDisplayNameIndex(int aIndex)
      Specifies the index of the feature to be the VOR display name.
      Parameters:
      aIndex - the index of the feature to be used as display name
    • setTACANDefaultDisplayNameIndex

      public void setTACANDefaultDisplayNameIndex(int aIndex)
      Specifies the index of the feature to be the TACAN display name.
      Parameters:
      aIndex - the index of the feature to be used as display name
    • setDMEDefaultDisplayNameIndex

      public void setDMEDefaultDisplayNameIndex(int aIndex)
      Specifies the index of the feature to be the DME display name.
      Parameters:
      aIndex - the index of the feature to be used as display name
    • setNDBDefaultDisplayNameIndex

      public void setNDBDefaultDisplayNameIndex(int aIndex)
      Specifies the index of the feature to be the NDB display name.
      Parameters:
      aIndex - the index of the feature to be used as display name
    • setNavaidModel

      public void setNavaidModel(TLcdModelList aNavaidModel)
      Specifies a modelList of navaids.

      Please make sure there's a unique index on this modelList!

      Parameters:
      aNavaidModel - a modelList containing navaids
      See Also:
    • createRequiredIndices

      public void createRequiredIndices(TLcdModelList aModelList)
      Adds an index on the sub models of the specified navaid modelList.

      This method should be called before calling setNavaidModel method.

      Please make sure that the following features were decoded into the model objects of the specified navaid modellist:

      • ILcdNavaidFeature.IDENTIFIER,
      • ILcdNavaidFeature.TYPE,
      • ILcdNavaidFeature.COUNTRY_CODE,
      • ILcdNavaidFeature.KEY_CODE.
      If the features mentioned above weren't decoded into the navaids, this method will cause exceptions to be thrown!
      Parameters:
      aModelList - a modelList containing navaids
      See Also: