Class AbstractTokenDecoder

java.lang.Object
com.pervasive.datarush.encoding.binary.AbstractTokenDecoder
All Implemented Interfaces:
TokenDecoder
Direct Known Subclasses:
SparseRecordDecoder

public abstract class AbstractTokenDecoder extends Object implements TokenDecoder
Base class for TokenEncoders
  • Constructor Details

    • AbstractTokenDecoder

      protected AbstractTokenDecoder()
      Initializes a new decoder.
  • Method Details

    • setTarget

      public final void setTarget(TokenSettable target)
      This implementation sets the target variable and invokes the method doTargetUpdated(TokenSettable).
      Specified by:
      setTarget in interface TokenDecoder
      Parameters:
      target - the target buffer into which to decode.
    • decodeField

      public void decodeField(BinaryReader source, int fieldIndex, boolean skip)
      This implementation delegates to TokenDecoder.decode(BinaryReader, boolean). Implementations that require field-specific handling should override this method instead.
      Specified by:
      decodeField in interface TokenDecoder
      Parameters:
      source - the reader containing the encoding
      fieldIndex - the index of the field being decoded
      skip - a value of true means decode the bytes but don't set on target
    • getTarget

      protected final TokenSettable getTarget()
      Returns the current target held by this decoder.
      Returns:
      the current target held by this decoder.
    • doTargetUpdated

      protected abstract void doTargetUpdated(TokenSettable target)
      Sets the target buffer for decoding. Invoked when the target is initially set or updated.
      Parameters:
      target - the buffer into which decoded valued are written