Class AbstractTokenEncoder

java.lang.Object
com.pervasive.datarush.encoding.binary.AbstractTokenEncoder
All Implemented Interfaces:
TokenEncoder
Direct Known Subclasses:
AbstractScalarEncoder

public abstract class AbstractTokenEncoder extends Object implements TokenEncoder
Base class for TokenEncoders.
  • Constructor Details

    • AbstractTokenEncoder

      protected AbstractTokenEncoder()
      Initializes a new encoder.
  • Method Details

    • setSource

      public final void setSource(TokenValued source)
      This implementation sets the source variable and invokes the method doSourceUpdated(TokenValued).
      Specified by:
      setSource in interface TokenEncoder
      Parameters:
      source - the value container to encode
    • encodeField

      public void encodeField(BinaryBuilder buffer, int index)
      This implementation delegates to TokenEncoder.encode(BinaryBuilder). Implementations that require field-specific handling should override this method instead.
      Specified by:
      encodeField in interface TokenEncoder
      Parameters:
      buffer - the buffer to which to append the encoding
      index - the index of the field to encode
    • getSource

      protected final TokenValued getSource()
      Returns the current source held by this encoder.
      Returns:
      the current source held by this encoder.
    • doSourceUpdated

      protected abstract void doSourceUpdated(TokenValued source)
      Sets the source buffer for encoding. Invoked when the source is initially set or updated.
      Parameters:
      source - the buffer from which values to encode are read