Class WKTDictionary.Disambiguation

java.lang.Object
org.apache.sis.io.wkt.WKTDictionary.Disambiguation
Enclosing class:
WKTDictionary

private static final class WKTDictionary.Disambiguation extends Object
A special kind of value used in the WKTDictionary.definitions map when the same code is used by more than one authority and version. In the common case where a WKTDictionary instance contains definitions for only one namespace and version, this class will never be instantiated.
  • Field Details

    • previous

      private final WKTDictionary.Disambiguation previous
      The previous Disambiguation in a linked list, or null if we reached the end of list. The use of a linked list should be efficient enough if the amount of Disambiguations for a given code is small.
    • codespace

      private final String codespace
      The authority (or other kind of code space) providing CRS definitions.
    • version

      private final String version
      Version of the CRS definition, or null if unspecified.
    • value

      Object value
      The value as an StoredTree before parsing or an IdentifiedObject after parsing. They are the kind of types documented in WKTDictionary.definitions, excluding other Disambiguation instances.
  • Constructor Details

    • Disambiguation

      private Disambiguation(org.opengis.referencing.IdentifiedObject object)
      Creates a new Disambiguation instance as a wrapper around the given identifier object. This constructor may be invoked if WKTDictionary has been used for creating some objects before new definitions are added. It should rarely happen.
      Parameters:
      object - the CRS (or other geodetic object) to wrap.
    • Disambiguation

      private Disambiguation(StoredTree object)
      Creates a new Disambiguation instance as a wrapper around the given identifier object.
      Parameters:
      object - definition in WKT of the CRS (or other geodetic object) to wrap.
    • Disambiguation

      Disambiguation(String codespace, String version, String code, Object oldValue, Object newValue)
      Creates a new Disambiguation instance identified by codespace:version:code.
      Parameters:
      codespace - the authority (or other kind of code space) providing CRS definitions.
      version - version of the CRS definition, or null if unspecified.
      code - code allocated by the authority for the CRS definition.
      oldValue - previous value for the same code, or null if none.
      newValue - the CRS (or other geodetic object) definition.
      Throws:
      IllegalArgumentException - if authority:version:code identifier is already used.
      See Also:
  • Method Details

    • find

      static WKTDictionary.Disambiguation find(WKTDictionary.Disambiguation choices, String codespace, String version, String code) throws org.opengis.referencing.NoSuchAuthorityCodeException
      Finds the Disambiguation for the given authority and version.
      Parameters:
      choices - end of a linked list of Disambiguations, or null if none.
      codespace - the authority providing CRS definitions, or null if unspecified.
      version - version of the CRS definition, or null if unspecified.
      code - code allocated by the authority for the CRS definition.
      Returns:
      container for the given authority and version, or null if none.
      Throws:
      org.opengis.referencing.NoSuchAuthorityCodeException - if the given authority and version are ambiguous.
    • list

      static void list(WKTDictionary.Disambiguation choices, String code, Predicate<Object> filter, Set<String> addTo)
      Adds all authority codes to the given set.
      Parameters:
      choices - end of a linked list of Disambiguations.
      code - authority code (code space and version may vary).
      filter - filter to apply of elements to add in the set.
      addTo - where to add the codespace:version:code tuples.
      See Also:
    • identifier

      private String identifier(String code)
      Creates an authority:version:code identifier with the given code. This is used for formatting error messages.
    • identifier

      private static String identifier(String codespace, String version, String code)
      Creates an authority:version:code identifier with the given code. This is used for formatting error messages.