Interface TokenEncoder

All Known Subinterfaces:
ComparableTokenEncoder
All Known Implementing Classes:
AbstractScalarEncoder, AbstractTokenEncoder

public interface TokenEncoder
Converts token values into a binary encoding. Implementations should extend AbstractTokenEncoder rather than implementing this interface directly.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends the encoded version of the current value of the source to the supplied buffer.
    void
    encodeField(BinaryBuilder buffer, int index)
    Appends the encoded version of the current value of the source to the supplied buffer.
    void
    Sets the container holding values to be encoded.
  • Method Details

    • setSource

      void setSource(TokenValued source)
      Sets the container holding values to be encoded. A reference to this container is held and accessed only when an encoding is requested.
      Parameters:
      source - the value container to encode
    • encode

      void encode(BinaryBuilder buffer)
      Appends the encoded version of the current value of the source to the supplied buffer.
      Parameters:
      buffer - the buffer to which to append the encoding
    • encodeField

      void encodeField(BinaryBuilder buffer, int index)
      Appends the encoded version of the current value of the source to the supplied buffer.
      Parameters:
      buffer - the buffer to which to append the encoding
      index - the index of the field to encode