Enum Class WfMessageCodec.Encoding

java.lang.Object
java.lang.Enum<WfMessageCodec.Encoding>
org.whiteflagprotocol.java.core.WfMessageCodec.Encoding
All Implemented Interfaces:
Serializable, Comparable<WfMessageCodec.Encoding>, Constable
Enclosing class:
WfMessageCodec

public static enum WfMessageCodec.Encoding extends Enum<WfMessageCodec.Encoding>
Whiteflag message compressed field encodings

Whiteflag fields use these compressed encodings, as defined for each message field in the Whiteflag specification.

Since:
1.1
  • 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
    1-bit binary encoded bit
    4-bit binary encoded date-time coordinate
    4-bit binary encoded decimal
    4-bit binary encoded time duration
    4-bit binary encoded hexadecimal
    4-bit binary encoded latitude coordinate
    4-bit binary encoded longitude coordinate
    8-bit binary encoded 1-byte UTF-8 character
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the bit length the totol number of bits for a fixed length field, else the bits to encode a single character
    int
    bitLength(int byteLength)
    Returns the bit length of a field for a given encoding and unencoded field byte length
    int
    Returns the byte length for a fixed length unencoded field, else -1
    Returns the allowed charters for a given encoding
    boolean
    Checks if this encoding requires a fixed field length
    Returns the generic regular expression for a given encoding
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • values

      public static WfMessageCodec.Encoding[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static WfMessageCodec.Encoding valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • charset

      public String charset()
      Returns the allowed charters for a given encoding
      Returns:
      a regex character set, e.g. [0-9]
    • regex

      public String regex()
      Returns the generic regular expression for a given encoding
      Returns:
      a regex expression
    • isFixedLength

      public boolean isFixedLength()
      Checks if this encoding requires a fixed field length
      Returns:
      TRUE if the encoding requires a fixed field length
    • byteLength

      public int byteLength()
      Returns the byte length for a fixed length unencoded field, else -1
      Returns:
      the byte length for a fixed length unencoded field, or -1 for variable length fields
    • bitLength

      public int bitLength()
      Returns the bit length the totol number of bits for a fixed length field, else the bits to encode a single character
      Returns:
      the bit length for a fixed length encoded field, or the bits to encode a single character of a
    • bitLength

      public int bitLength(int byteLength)
      Returns the bit length of a field for a given encoding and unencoded field byte length
      Parameters:
      byteLength - the number of bytes in the unencoded field
      Returns:
      the number of bits in a compressed encoded field