Class CommonAuthorityCode
java.lang.Object
org.apache.sis.referencing.factory.CommonAuthorityCode
Result of parsing a code in "OGC", "CRS", "AUTO" or "AUTO2" namespace.
- Since:
- 0.7
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
The remaining part of the code afterlocalCode
, ornull
if none.(package private) final boolean
Whether the first character oflocalCode
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 parsingcomplement
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
ConstructorsConstructorDescriptionCommonAuthorityCode
(String code) Finds the index where the code begins, ignoring spaces and the"OGC"
,"CRS"
,"AUTO"
,"AUTO1"
or"AUTO2"
namespaces if present. -
Method Summary
Modifier and TypeMethodDescription(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.
-
Field Details
-
SEPARATOR
static final char SEPARATORThe parameter separator for codes in the"AUTO(2)"
namespace.- See Also:
-
localCode
Local part of the code, without the authority part and without the parameters. -
complement
The remaining part of the code afterlocalCode
, ornull
if none. This part may exist with codes in theAUTO
orAUTO2
namespace. -
parameters
private double[] parametersThe result of parsingcomplement
as numerical parameters. Computed byparameters()
when first requested. -
versionOfAuto
private int versionOfAutoIf the authority is"AUTO"
, version of that authority (1 or 2). Otherwise 0. -
isNumeric
final boolean isNumericWhether the first character oflocalCode
is a decimal digit, the minus or the plus character. -
isOGC
boolean isOGCtrue
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#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 returnstrue
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
Returns the error message for unexpected parameters after the code.
-