org.apache.lucene.facet.encoding
Class FourFlagsIntEncoder

java.lang.Object
  extended by org.apache.lucene.facet.encoding.IntEncoder
      extended by org.apache.lucene.facet.encoding.ChunksIntEncoder
          extended by org.apache.lucene.facet.encoding.FourFlagsIntEncoder
Direct Known Subclasses:
NOnesIntEncoder

public class FourFlagsIntEncoder
extends ChunksIntEncoder

A ChunksIntEncoder which encodes values in chunks of 4. Every group starts with a single byte (called indicator) which represents 4 - 2 bit flags, where the values:

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.facet.encoding.ChunksIntEncoder
encodeQueue, indicator, ordinal
 
Constructor Summary
FourFlagsIntEncoder()
           
 
Method Summary
 IntDecoder createMatchingDecoder()
          Returns an IntDecoder which can decode the values that were encoded with this encoder.
 void encode(IntsRef values, BytesRef buf)
          Encodes the values to the given buffer.
 String toString()
           
 
Methods inherited from class org.apache.lucene.facet.encoding.ChunksIntEncoder
encodeChunk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FourFlagsIntEncoder

public FourFlagsIntEncoder()
Method Detail

encode

public void encode(IntsRef values,
                   BytesRef buf)
Description copied from class: IntEncoder
Encodes the values to the given buffer. Note that the buffer's offset and length are set to 0.

Specified by:
encode in class IntEncoder

createMatchingDecoder

public IntDecoder createMatchingDecoder()
Description copied from class: IntEncoder
Returns an IntDecoder which can decode the values that were encoded with this encoder.

Specified by:
createMatchingDecoder in class IntEncoder

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.