public class NOnesIntEncoder extends FourFlagsIntEncoder
FourFlagsIntEncoderwhich translates the data as follows:
value+1(2 ⇒ 3, 3 ⇒ 4 and so forth).
Noccurrences of 1 are encoded as a single 2.
Integer.MAX_VALUE. 0 is not supported because it's not supported by
Integer.MAX_VALUEbecause this encoder translates N to N+1, which will cause an overflow and
Integer.MAX_VALUEwill become a negative number, which is not supported as well.
Integer.MAX_VALUE. If it is not the first value to encode, and you wrap this encoder with
DGapIntEncoder, then the value that will be sent to this encoder will be
MAX_VAL - prev.
|Constructor and Description|
Constructs an encoder with a given value of N (N: Number of consecutive '1's to be translated into single target value '2').
|Modifier and Type||Method and Description|
Encodes the values to the given buffer.
public NOnesIntEncoder(int n)
public IntDecoder createMatchingDecoder()
IntDecoderwhich can decode the values that were encoded with this encoder.
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.