-
- All Known Subinterfaces:
ComparableTokenEncoder
- All Known Implementing Classes:
AbstractScalarEncoder
,AbstractTokenEncoder
public interface TokenEncoder
Converts token values into a binary encoding. Implementations should extendAbstractTokenEncoder
rather than implementing this interface directly.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
encode(BinaryBuilder buffer)
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
setSource(TokenValued source)
Sets the container holding values to be encoded.
-
-
-
Method Detail
-
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 encodingindex
- the index of the field to encode
-
-