Class CommonAuthorityCode

java.lang.Object
org.apache.sis.referencing.factory.CommonAuthorityCode

final class CommonAuthorityCode extends Object
Result of parsing a code in "OGC", "CRS", "AUTO" or "AUTO2" namespace.
Since:
0.7
Version:
1.3
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
    The remaining part of the code after localCode, or null if none.
    (package private) final boolean
    Whether the first character of localCode is a decimal digit, the minus or the plus character.
    (package private) boolean
    true if the "OGC" namespace was explicitly specified.
    (package private) final String
    Local part of the code, without the authority part and without the parameters.
    private double[]
    The result of parsing complement as numerical parameters.
    (package private) static final char
    The parameter separator for codes in the "AUTO(2)" namespace.
    private int
    If the authority is "AUTO", version of that authority (1 or 2).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Finds the index where the code begins, ignoring spaces and the "OGC", "CRS", "AUTO", "AUTO1" or "AUTO2" namespaces if present.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) final boolean
    isAuto(boolean legacy)
    Returns whether the authority is "AUTO", "AUTO1" or "AUTO2".
    (package private) final boolean
    Returns whether there is no parameters.
    (package private) final double[]
    Returns the result of parsing the comma-separated list of optional parameters after the code.
    (package private) final String
    Returns the error message for unexpected parameters after the code.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SEPARATOR

      static final char SEPARATOR
      The parameter separator for codes in the "AUTO(2)" namespace.
      See Also:
    • localCode

      final String localCode
      Local part of the code, without the authority part and without the parameters.
    • complement

      private String complement
      The remaining part of the code after localCode, or null if none. This part may exist with codes in the AUTO or AUTO2 namespace.
    • parameters

      private double[] parameters
      The result of parsing complement as numerical parameters. Computed by parameters() when first requested.
    • versionOfAuto

      private int versionOfAuto
      If the authority is "AUTO", version of that authority (1 or 2). Otherwise 0.
    • isNumeric

      final boolean isNumeric
      Whether the first character of localCode is a decimal digit, the minus or the plus character.
    • isOGC

      boolean isOGC
      true if the "OGC" namespace was explicitly specified.
  • Constructor Details

    • CommonAuthorityCode

      CommonAuthorityCode(String code) throws org.opengis.referencing.NoSuchAuthorityCodeException
      Finds the index where the code begins, ignoring spaces and the "OGC", "CRS", "AUTO", "AUTO1" or "AUTO2" namespaces if present. If a namespace is found and is a legacy one, then the
      invalid reference
      #isLegacy
      flag will be set.
      Parameters:
      code - authority, code and parameters to parse.
      Throws:
      org.opengis.referencing.NoSuchAuthorityCodeException - if an authority is present but is not one of the recognized authorities.
  • Method Details

    • isAuto

      final boolean isAuto(boolean legacy)
      Returns whether the authority is "AUTO", "AUTO1" or "AUTO2".
      Parameters:
      legacy - whether to returns true only if the authority is "AUTO" or "AUTO1".
      Returns:
      whether the authority is some "AUTO" namespace.
    • isParameterless

      final boolean isParameterless()
      Returns whether there is no parameters.
    • parameters

      final double[] parameters()
      Returns the result of parsing the comma-separated list of optional parameters after the code. If there is no parameter, then this method returns an empty array. Caller should not modify the returned array.
      Returns:
      the parameters after the code, or an empty array if none.
      Throws:
      NumberFormatException - if at least one number cannot be parsed.
    • unexpectedParameters

      final String unexpectedParameters()
      Returns the error message for unexpected parameters after the code.