Class ALcdDAFIFAerodromeDecoder

All Implemented Interfaces:
ILcdDAFIFDecoder, ILcdInputStreamFactoryCapable, ILcdModelDecoder
Direct Known Subclasses:
TLcdDAFIFAerodromeDecoder, TLcdDAFIFHeliportDecoder

public abstract class ALcdDAFIFAerodromeDecoder extends ALcdDAFIFSingleModelDecoder
This extension of the ALcdDAFIFSingleModelDecoder class provides read methods to retrieve data from a aerodrome or heliport data file.

Records containing information about airports and about airport communication have the same structure as records containing information about heliports. Therefore, the read methods will be the same for these objects.

  • Field Details

    • fCommunicationFeaturesToBeDecoded

      protected String[] fCommunicationFeaturesToBeDecoded
      The set of all communications features to be decoded This may be set by the user. The accepted types are the union of the Airport Communications Features corresponding to FILE 0 (airports), formats 16,17,18, 19. These types are identical to the Heliport Communications features corresponding to FILE 1 (heliports), formats 13,14, 15 and 16.
    • fCommunicationFeaturesType1

      protected String[] fCommunicationFeaturesType1
      For each of the 4 formats, the particular features to decode. The formats are 16,17,18,19 for airports are identical to formats 13,14,15,16 for heliports. The formats are mapped to "Type1", "Type2", "Type3" and "Type4" respectively. This list is obtained from fCommunicationFeaturesToBeDecoded by calling splitAerodromeFeatures.
    • fCommunicationFeaturesType2

      protected String[] fCommunicationFeaturesType2
    • fCommunicationFeaturesType3

      protected String[] fCommunicationFeaturesType3
    • fCommunicationFeaturesType4

      protected String[] fCommunicationFeaturesType4
  • Constructor Details

    • ALcdDAFIFAerodromeDecoder

      public ALcdDAFIFAerodromeDecoder(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

    • readIdentification

      protected String readIdentification(char[] aRecord)
      Reads the identification of an aerodrome from a given record.

      The identification has no spaces.

      Parameters:
      aRecord - the record to read from
      Returns:
      the aerodrome identification
    • readCountryCodeFromFmt1

      protected String readCountryCodeFromFmt1(char[] aRecord)
      Returns the country code of an aerodrome.

      The country code is part of the aerodromes identification. The identification consists of 7 characters: 5 numbers preceded by the country code.

      Parameters:
      aRecord - the record to read from
      Returns:
      the country code
    • readNameFromFmt1

      protected String readNameFromFmt1(char[] aRecord)
      Reads the name of an aerodrome.

      Aerodrome names are found in records of format 01. A name has 38 characters and starts at the 14th position of the record. It should contain at least one character. An exception will be thrown if the name is empty.

      Parameters:
      aRecord - the record to read from
      Returns:
      the name
    • readICAOCodeFromFmt1

      protected String readICAOCodeFromFmt1(char[] aRecord)
      Reads an aerodromes ICAO code from a record of format 01.

      The ICAO code has 4 characters and starts at the 3th position of the record. It should contain at least 2 non-space characters. If not, an exception will be thrown

      Parameters:
      aRecord - the record to read from
      Returns:
      the ICAO code
    • readStateProvinceCodeFromFmt1

      protected Integer readStateProvinceCodeFromFmt1(char[] aRecord)
      Reads the state province code from a record of format 01.

      This code has length 2. The field may be empty.

      Parameters:
      aRecord - the record to read from
      Returns:
      the State Province code
    • readFAAHostCountryIdentifierFromFmt1

      protected String readFAAHostCountryIdentifierFromFmt1(char[] aRecord)
      Reads the Federal Aviation Administration identifier/host country identifier.

      This 4 letter - String contains at least 1 character. If it 's empty, an exception will be thrown.

      Parameters:
      aRecord - the record to read from
      Returns:
      the Federal Aviation Administration identifier/host country identifier
    • readLon

      protected double readLon(char[] aRecord)
      Reads a longitude.
      Parameters:
      aRecord - the record to read from
      Returns:
      the longitude
    • readLat

      protected double readLat(char[] aRecord)
      Reads a latitude.
      Parameters:
      aRecord - the record to read from
      Returns:
      the latitude
    • readGeodeticLon

      protected double readGeodeticLon(char[] aRecord)
      Reads a geodetic longitude.
      Parameters:
      aRecord - the record to read from
      Returns:
      the longitude
    • readGeodeticLat

      protected double readGeodeticLat(char[] aRecord)
      Reads a geodetic latitude.
      Parameters:
      aRecord - the record to read from
      Returns:
      the latitude
    • readLocalHorizontalDatumFromFmt1

      protected ILcdGeodeticDatum readLocalHorizontalDatumFromFmt1(char[] aRecord)
      Reads the local horizontal datum from a record of format 01.

      This field must not be empty. If it is, an exception will be thrown.

      Parameters:
      aRecord - the record to read from
      Returns:
      the geodetic datum of the source coordinates
    • readOperationsTypeFromFmt1

      protected TLcdAerodromeOperationsType readOperationsTypeFromFmt1(char[] aRecord)
      Reads an aerodromes type from a record of format 01.

      A type is defined by one single character (values 'A', 'B', 'C' or 'D') and results in an object of TLcdAirportType.

      Parameters:
      aRecord - the record to read from
      Returns:
      the operationsType
    • readElevationFromFmt1

      protected double readElevationFromFmt1(char[] aRecord)
      Reads the elevation of an aerodrome.

      The elevation starts at the 102nd position of a record of format 01 and it consists of 5 characters. The elevation is measured in meter.

      Parameters:
      aRecord - the record to read from
      Returns:
      the elevation
    • readRotatingBeaconFromFmt1

      protected boolean readRotatingBeaconFromFmt1(char[] aRecord)
      Reads the rotating beacon of an aerodrome.

      This field should contain 'Y' or ' '. If not, an IllegalArgumentException will be thrown.

      Parameters:
      aRecord - the record to read from
      Returns:
      a flag indicating whether this aerodrome has a rotating beacon
    • readMagneticVariation

      protected String readMagneticVariation(char[] aRecord)
      Reads the magnetic variation from a record of format 01.

      The magnetic variation has length 12. If not, an exception will be thrown.

      Parameters:
      aRecord - the record to read from
      Returns:
      the magnetic variation
    • readWACFromFmt1

      protected String readWACFromFmt1(char[] aRecord)
      Reads the world area code from a record of format 01.

      This code has length 4 and at least 2 characters are no space. If less than 2 characters are found, an exception will be thrown.

      Parameters:
      aRecord - the record to read from
      Returns:
      the WAC
    • getTypeForChar

      protected TLcdAerodromeOperationsType getTypeForChar(char aType)
      Returns the unique TLcdAirportType object attached to the given character.

      If there's no TLcdAirportType object provided for the given character, an IllegalArgumentException is thrown.

      Parameters:
      aType - a code for the operationsType
      Returns:
      the operationsType according to the given code
    • readCommunicationType

      protected TLcdCommunicationType readCommunicationType(char[] aRecord)
      Reads the communication type from a communication record
      Parameters:
      aRecord -
      Returns:
      the communication type as a TLcdCommunicationType object
    • readCommunicationTypeMultiplierFromType1

      protected Integer readCommunicationTypeMultiplierFromType1(char[] aRecord)
      Reads the communication type multiplier from a communication record of format 16 - airports or 13 - heliports.
      Parameters:
      aRecord -
      Returns:
      the communication type multiplier as an Integer
    • readCommunicationTypeMultiplierFromType2

      protected Integer readCommunicationTypeMultiplierFromType2(char[] aRecord)
      Reads the communication type multiplier from a communication record of format 17 - airports or 14 - heliports.
      Parameters:
      aRecord -
      Returns:
      the communication type multiplier as an Integer
    • readCommunicationTypeMultiplierFromType3

      protected Integer readCommunicationTypeMultiplierFromType3(char[] aRecord)
      Reads the communication type multiplier from a communication record of format 18 - airports or 15 - heliports.
      Parameters:
      aRecord -
      Returns:
      the communication type multiplier as an Integer
    • readCommunicationTypeMultiplierFromType4

      protected Integer readCommunicationTypeMultiplierFromType4(char[] aRecord)
      Reads the communication type multiplier from a communication record of format 19 - airports or 16 - heliports.
      Parameters:
      aRecord -
      Returns:
      the communication type multiplier as an Integer
    • readCommunicationRemarkSequenceNumber

      protected Integer readCommunicationRemarkSequenceNumber(char[] aRecord)
      Reads the remark sequence number from a communication record of format 19 - airports or 16 - heliports
      Parameters:
      aRecord -
      Returns:
      the remark sequence number
    • readCommunicationRemark

      protected String readCommunicationRemark(char[] aRecord)
      Reads the remark text from a communication record of format 19 - airports or 16 - heliports
      Parameters:
      aRecord -
      Returns:
      the remark text
    • setCommunicationFeaturesToBeDecoded

      public void setCommunicationFeaturesToBeDecoded(String[] aAerodromeCommunicationsFeaturesToBeDecoded)
      Sets the airport/heliport communications features to be decoded. The legal names of the features are those present in ILcdDAFIFCommunicationFeature.
      Parameters:
      aAerodromeCommunicationsFeaturesToBeDecoded - an array of communication features
      See Also:
    • readCommunicationFeaturesFromType1

      protected TLcdFeaturedService readCommunicationFeaturesFromType1(char[] aRecord)
      Reads a full record having format 16 (airports) / 13 (heliports) The created TLcdFeaturedService has the same number of features as specified by fCommunicationFeaturesToBeDecoded, but only the fCommunicationFeaturesType1 are actually filled in.
    • readCommunicationFeaturesFromType2

      protected TLcdFeaturedService readCommunicationFeaturesFromType2(char[] aRecord)
      Reads a full record having format 17 (airports) / 14 (heliports) The created TLcdFeaturedService has the same number of features as specified by fCommunicationFeaturesToBeDecoded, but only the fCommunicationFeaturesType1 are actually filled in.
    • readCommunicationFeaturesFromType3

      protected TLcdFeaturedService readCommunicationFeaturesFromType3(char[] aRecord)
      Reads a full record having format 18 (airports) / 15 (heliports) The created TLcdFeaturedService has the same number of features as specified by fCommunicationFeaturesToBeDecoded, but only the fCommunicationFeaturesType1 are actually filled in.
    • splitAerodromeFeatures

      protected void splitAerodromeFeatures()
      Given the complete fCommunicationFeaturesToBeDecoded list, it finds the features that have to be extracted from each type of format. Also computes the position (mapping) of each feature into the final vector.