public class TrimInfixAndSuffixEncoder extends java.lang.Object implements ISequenceEncoder
dst relative to src by trimming whatever
non-equal suffix and infix src and dst have. The
output code is (bytes):
{X}{L}{K}{suffix}
where src's infix at position (X - 'A') and of
length (L - 'A') should be removed, then (K -
'A') bytes should be trimmed from the end and then the suffix
should be appended to the resulting byte sequence.
Examples:
src: ayz dst: abc encoded: AACbc src: aillent dst: aller encoded: BBCr
| Constructor and Description |
|---|
TrimInfixAndSuffixEncoder() |
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
decode(java.nio.ByteBuffer reuse,
java.nio.ByteBuffer source,
java.nio.ByteBuffer encoded)
Decodes
encoded relative to source,
optionally reusing the provided ByteBuffer. |
java.nio.ByteBuffer |
encode(java.nio.ByteBuffer reuse,
java.nio.ByteBuffer source,
java.nio.ByteBuffer target)
Encodes
target relative to source,
optionally reusing the provided ByteBuffer. |
int |
prefixBytes()
The number of encoded form's prefix bytes that should be ignored (needed for separator lookup).
|
java.lang.String |
toString() |
public java.nio.ByteBuffer encode(java.nio.ByteBuffer reuse,
java.nio.ByteBuffer source,
java.nio.ByteBuffer target)
ISequenceEncodertarget relative to source,
optionally reusing the provided ByteBuffer.encode in interface ISequenceEncoderreuse - Reuses the provided ByteBuffer or allocates a new one if there is not enough remaining space.source - The source byte sequence.target - The target byte sequence to encode relative to sourceByteBuffer with encoded target.public int prefixBytes()
ISequenceEncoderprefixBytes in interface ISequenceEncoderpublic java.nio.ByteBuffer decode(java.nio.ByteBuffer reuse,
java.nio.ByteBuffer source,
java.nio.ByteBuffer encoded)
ISequenceEncoderencoded relative to source,
optionally reusing the provided ByteBuffer.decode in interface ISequenceEncoderreuse - Reuses the provided ByteBuffer or allocates a new one if there is not enough remaining space.source - The source byte sequence.encoded - The previously encoded byte sequence.ByteBuffer with decoded target.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018. All rights reserved.