Enum GeohashReferenceSystem.Format
java.lang.Object
java.lang.Enum<GeohashReferenceSystem.Format>
org.apache.sis.referencing.gazetteer.GeohashReferenceSystem.Format
- All Implemented Interfaces:
Serializable
,Comparable<GeohashReferenceSystem.Format>
,java.lang.constant.Constable
- Enclosing class:
- GeohashReferenceSystem
The encoding format used by
GeohashReferenceSystem.Coder
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final byte[]
Mapping from a lower-case letter symbols to its numerical value.(package private) final byte[]
Mapping from a upper-case letter symbols to its numerical value.(package private) final byte[]
Mapping from a numerical value to its symbol.(package private) final int
A single one-bit in the position of the highest-order ("leftmost") one-bit of the value represented by a letter or digit. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Format
(int highestOneBit, byte[] encoding) Creates a new format for the given mapping. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this type with the specified name.static GeohashReferenceSystem.Format[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
BASE32
Format consisting of 32 symbols used athttp://geohash.org
. This encoding uses digits 0 to 9, and lower-case letters'b'
to'z'
excluding'i'
,'l'
and'o'
. Decoding is case-insensitive.
-
-
Field Details
-
highestOneBit
final int highestOneBitA single one-bit in the position of the highest-order ("leftmost") one-bit of the value represented by a letter or digit. This value can be computed as1 << (numBits-1)
wherenumBits
is the number of bits needed for representing a letter or digit. -
encoding
final byte[] encodingMapping from a numerical value to its symbol. The length of this array is the base of the encoding, e.g. 32 forBASE32
. -
decodingLowerCase
final byte[] decodingLowerCaseMapping from a lower-case letter symbols to its numerical value. -
decodingUpperCase
final byte[] decodingUpperCaseMapping from a upper-case letter symbols to its numerical value. This is the same array thandecodingLowerCase
if the format is case-insensitive.
-
-
Constructor Details
-
Format
private Format(int highestOneBit, byte[] encoding) Creates a new format for the given mapping. This constructor computes thedecoding
arrays from theencoding
one.- Parameters:
highestOneBit
- the leftmost one-bit of the value represented by a letter or digit.encoding
- the mapping from numerical values to symbols.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-