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 StringThe authority (or other kind of code space) providing CRS definitions.private final WKTDictionary.DisambiguationThe previousDisambiguationin a linked list, ornullif we reached the end of list.(package private) ObjectThe value as anStoredTreebefore parsing or anIdentifiedObjectafter parsing.private final StringVersion of the CRS definition, ornullif unspecified. -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)Creates a newDisambiguationinstance identified bycodespace:version:code.privateDisambiguation(StoredTree object) Creates a newDisambiguationinstance as a wrapper around the given identifier object.privateDisambiguation(org.opengis.referencing.IdentifiedObject object) Creates a newDisambiguationinstance as a wrapper around the given identifier object. -
Method Summary
Modifier and TypeMethodDescription(package private) static WKTDictionary.Disambiguationfind(WKTDictionary.Disambiguation choices, String codespace, String version, String code) Finds theDisambiguationfor the given authority and version.private Stringidentifier(String code) Creates an authority:version:code identifier with the given code.private static Stringidentifier(String codespace, String version, String code) Creates an authority:version:code identifier with the given code.(package private) static voidlist(WKTDictionary.Disambiguation choices, String code, Predicate<Object> filter, Set<String> addTo) Adds all authority codes to the given set.
-
Field Details
-
previous
The previousDisambiguationin a linked list, ornullif we reached the end of list. The use of a linked list should be efficient enough if the amount ofDisambiguations for a given code is small. -
codespace
The authority (or other kind of code space) providing CRS definitions. -
version
Version of the CRS definition, ornullif unspecified. -
value
Object valueThe value as anStoredTreebefore parsing or anIdentifiedObjectafter parsing. They are the kind of types documented inWKTDictionary.definitions, excluding otherDisambiguationinstances.
-
-
Constructor Details
-
Disambiguation
private Disambiguation(org.opengis.referencing.IdentifiedObject object) Creates a newDisambiguationinstance as a wrapper around the given identifier object. This constructor may be invoked ifWKTDictionaryhas 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 newDisambiguationinstance 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 newDisambiguationinstance identified bycodespace:version:code.- Parameters:
codespace- the authority (or other kind of code space) providing CRS definitions.version- version of the CRS definition, ornullif unspecified.code- code allocated by the authority for the CRS definition.oldValue- previous value for the same code, ornullif 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 theDisambiguationfor the given authority and version.- Parameters:
choices- end of a linked list ofDisambiguations, ornullif none.codespace- the authority providing CRS definitions, ornullif unspecified.version- version of the CRS definition, ornullif unspecified.code- code allocated by the authority for the CRS definition.- Returns:
- container for the given authority and version, or
nullif 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 ofDisambiguations.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:codetuples.- 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.
-