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 StringThe remaining part of the code afterlocalCode, ornullif none.(package private) final booleanWhether the first character oflocalCodeis a decimal digit, the minus or the plus character.(package private) booleantrueif the "OGC" namespace was explicitly specified.(package private) final StringLocal part of the code, without the authority part and without the parameters.private double[]The result of parsingcomplementas numerical parameters.(package private) static final charThe parameter separator for codes in the"AUTO(2)"namespace.private intIf 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 booleanisAuto(boolean legacy) Returns whether the authority is "AUTO", "AUTO1" or "AUTO2".(package private) final booleanReturns 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 StringReturns 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, ornullif none. This part may exist with codes in theAUTOorAUTO2namespace. -
parameters
private double[] parametersThe result of parsingcomplementas 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 oflocalCodeis a decimal digit, the minus or the plus character. -
isOGC
boolean isOGCtrueif 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#isLegacyflag 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 returnstrueonly 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.
-