Package org.apache.lucene.util.encoding
Class NOnesIntDecoder
- java.lang.Object
-
- org.apache.lucene.util.encoding.IntDecoder
-
- org.apache.lucene.util.encoding.FourFlagsIntDecoder
-
- org.apache.lucene.util.encoding.NOnesIntDecoder
-
public class NOnesIntDecoder extends FourFlagsIntDecoder
Decodes data which was encoded byNOnesIntEncoder. Uses aFourFlagsIntDecoderto perform the actual encoding and translates the values back as described inNOnesIntEncoder.- See Also:
NOnesIntEncoder- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.util.encoding.IntDecoder
EOS, in
-
-
Constructor Summary
Constructors Constructor Description NOnesIntDecoder(int n)Constructs a decoder with a given N (Number of consecutive '1's which are translated into a single target value '2'.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longdecode()Decodes data received from the input stream, and returns one decoded integer.voidreInit(InputStream in)Sets the input stream from which the encoded data is read.StringtoString()
-
-
-
Method Detail
-
decode
public long decode() throws IOExceptionDescription copied from class:IntDecoderDecodes data received from the input stream, and returns one decoded integer. If end of stream is reached,IntDecoder.EOSis returned.- Overrides:
decodein classFourFlagsIntDecoder- Returns:
- one decoded integer as long or
IntDecoder.EOSif end-of-stream reached. - Throws:
IOException- if an I/O error occurs
-
reInit
public void reInit(InputStream in)
Description copied from class:IntDecoderSets the input stream from which the encoded data is read.- Overrides:
reInitin classFourFlagsIntDecoder
-
toString
public String toString()
- Overrides:
toStringin classFourFlagsIntDecoder
-
-