org.apache.lucene.util.encoding
Class NOnesIntDecoder

java.lang.Object
  extended by org.apache.lucene.util.encoding.IntDecoder
      extended by org.apache.lucene.util.encoding.FourFlagsIntDecoder
          extended by org.apache.lucene.util.encoding.NOnesIntDecoder

public class NOnesIntDecoder
extends FourFlagsIntDecoder

Decodes data which was encoded by NOnesIntEncoder. Uses a FourFlagsIntDecoder to perform the actual encoding and translates the values back as described in NOnesIntEncoder.

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
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
 long decode()
          Decodes data received from the input stream, and returns one decoded integer.
 void reInit(InputStream in)
          Sets the input stream from which the encoded data is read.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NOnesIntDecoder

public 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 Detail

decode

public long decode()
            throws IOException
Description copied from class: IntDecoder
Decodes data received from the input stream, and returns one decoded integer. If end of stream is reached, IntDecoder.EOS is returned.

Overrides:
decode in class FourFlagsIntDecoder
Returns:
one decoded integer as long or IntDecoder.EOS if end-of-stream reached.
Throws:
IOException - if an I/O error occurs

reInit

public void reInit(InputStream in)
Description copied from class: IntDecoder
Sets the input stream from which the encoded data is read.

Overrides:
reInit in class FourFlagsIntDecoder

toString

public String toString()
Overrides:
toString in class FourFlagsIntDecoder