org.apache.lucene.util.encoding
Class EightFlagsIntEncoder

java.lang.Object
  extended by org.apache.lucene.util.encoding.IntEncoder
      extended by org.apache.lucene.util.encoding.ChunksIntEncoder
          extended by org.apache.lucene.util.encoding.EightFlagsIntEncoder

public class EightFlagsIntEncoder
extends ChunksIntEncoder

A ChunksIntEncoder which encodes data in chunks of 8. Every group starts with a single byte (called indicator) which represents 8 - 1 bit flags, where the value:

Encoding example:

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.ChunksIntEncoder
encodeQueue, encodeQueueSize, encoder, indicator, ordinal
 
Fields inherited from class org.apache.lucene.util.encoding.IntEncoder
out
 
Constructor Summary
EightFlagsIntEncoder()
           
 
Method Summary
 IntDecoder createMatchingDecoder()
          Returns an IntDecoder which matches this encoder.
 void encode(int data)
          Encodes an integer to the output stream given in reInit
 String toString()
           
 
Methods inherited from class org.apache.lucene.util.encoding.ChunksIntEncoder
close, encodeChunk, reInit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EightFlagsIntEncoder

public EightFlagsIntEncoder()
Method Detail

encode

public void encode(int data)
            throws IOException
Description copied from class: IntEncoder
Encodes an integer to the output stream given in reInit

Specified by:
encode in class IntEncoder
Throws:
IOException

createMatchingDecoder

public IntDecoder createMatchingDecoder()
Description copied from class: IntEncoder
Returns an IntDecoder which matches this encoder. Every encoder must return an IntDecoder and null is not a valid value. If an encoder is just a filter, it should at least return its wrapped encoder's matching decoder.

NOTE: this method should create a new instance of the matching decoder and leave the instance sharing to the caller. Returning the same instance over and over is risky because encoders and decoders are not thread safe.

Specified by:
createMatchingDecoder in class IntEncoder

toString

public String toString()
Overrides:
toString in class Object