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

public static enum GeohashReferenceSystem.Format extends Enum<GeohashReferenceSystem.Format>
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
    Enum Constant
    Description
    Format consisting of 32 symbols used at http://geohash.org.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (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

    Constructors
    Modifier
    Constructor
    Description
    private
    Format(int highestOneBit, byte[] encoding)
    Creates a new format for the given mapping.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • BASE32

      public static final GeohashReferenceSystem.Format BASE32
      Format consisting of 32 symbols used at http://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 highestOneBit
      A 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 as 1 << (numBits-1) where numBits is the number of bits needed for representing a letter or digit.
    • encoding

      final byte[] encoding
      Mapping from a numerical value to its symbol. The length of this array is the base of the encoding, e.g. 32 for BASE32.
    • decodingLowerCase

      final byte[] decodingLowerCase
      Mapping from a lower-case letter symbols to its numerical value.
    • decodingUpperCase

      final byte[] decodingUpperCase
      Mapping from a upper-case letter symbols to its numerical value. This is the same array than decodingLowerCase 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 the decoding arrays from the encoding 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

      public static GeohashReferenceSystem.Format[] 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

      public static GeohashReferenceSystem.Format valueOf(String name)
      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 name
      NullPointerException - if the argument is null