Package org.apache.sis.io.wkt
Class WKTDictionary.Disambiguation
java.lang.Object
org.apache.sis.io.wkt.WKTDictionary.Disambiguation
- Enclosing class:
- WKTDictionary
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final String
The authority (or other kind of code space) providing CRS definitions.private final WKTDictionary.Disambiguation
The previousDisambiguation
in a linked list, ornull
if we reached the end of list.(package private) Object
The value as anStoredTree
before parsing or anIdentifiedObject
after parsing.private final String
Version of the CRS definition, ornull
if unspecified. -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
Creates a newDisambiguation
instance identified bycodespace:version:code
.private
Disambiguation
(StoredTree object) Creates a newDisambiguation
instance as a wrapper around the given identifier object.private
Disambiguation
(org.opengis.referencing.IdentifiedObject object) Creates a newDisambiguation
instance as a wrapper around the given identifier object. -
Method Summary
Modifier and TypeMethodDescription(package private) static WKTDictionary.Disambiguation
find
(WKTDictionary.Disambiguation choices, String codespace, String version, String code) Finds theDisambiguation
for the given authority and version.private String
identifier
(String code) Creates an authority:version:code identifier with the given code.private static String
identifier
(String codespace, String version, String code) Creates an authority:version:code identifier with the given code.(package private) static void
list
(WKTDictionary.Disambiguation choices, String code, Predicate<Object> filter, Set<String> addTo) Adds all authority codes to the given set.
-
Field Details
-
previous
The previousDisambiguation
in a linked list, ornull
if we reached the end of list. The use of a linked list should be efficient enough if the amount ofDisambiguation
s for a given code is small. -
codespace
The authority (or other kind of code space) providing CRS definitions. -
version
Version of the CRS definition, ornull
if unspecified. -
value
Object valueThe value as anStoredTree
before parsing or anIdentifiedObject
after parsing. They are the kind of types documented inWKTDictionary.definitions
, excluding otherDisambiguation
instances.
-
-
Constructor Details
-
Disambiguation
private Disambiguation(org.opengis.referencing.IdentifiedObject object) Creates a newDisambiguation
instance as a wrapper around the given identifier object. This constructor may be invoked ifWKTDictionary
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
Creates a newDisambiguation
instance as a wrapper around the given identifier object.- Parameters:
object
- definition in WKT of the CRS (or other geodetic object) to wrap.
-
Disambiguation
Creates a newDisambiguation
instance identified bycodespace:version:code
.- Parameters:
codespace
- the authority (or other kind of code space) providing CRS definitions.version
- version of the CRS definition, ornull
if unspecified.code
- code allocated by the authority for the CRS definition.oldValue
- previous value for the same code, ornull
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 theDisambiguation
for the given authority and version.- Parameters:
choices
- end of a linked list ofDisambiguation
s, ornull
if none.codespace
- the authority providing CRS definitions, ornull
if unspecified.version
- version of the CRS definition, ornull
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 ofDisambiguation
s.code
- authority code (code space and version may vary).filter
- filter to apply of elements to add in the set.addTo
- where to add thecodespace:version:code
tuples.- See Also:
-
identifier
Creates an authority:version:code identifier with the given code. This is used for formatting error messages. -
identifier
Creates an authority:version:code identifier with the given code. This is used for formatting error messages.
-