Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.facet.encoding
Class DGapIntEncoder

    java.lang.Object
      org.apache.lucene.facet.encoding.IntEncoder
          org.apache.lucene.facet.encoding.IntEncoderFilter
              org.apache.lucene.facet.encoding.DGapIntEncoder

    public final class DGapIntEncoder

extends IntEncoderFilter

An `IntEncoderFilter` which encodes the gap between the given values, rather than the values themselves. This encoder usually yields better encoding performance space-wise (i.e., the final encoded values consume less space) if the values are 'close' to each other.

NOTE: this encoder assumes the values are given to `encode(IntsRef, BytesRef)` in an ascending sorted manner, which ensures only positive values are encoded and thus yields better performance. If you are not sure whether the values are sorted or not, it is possible to chain this encoder with `SortingIntEncoder` to ensure the values will be sorted before encoding.

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.IntEncoderFilter
`encoder`

Constructor Summary
`DGapIntEncoder(IntEncoder encoder)` Initializes with the given encoder.

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 java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### DGapIntEncoder

    public DGapIntEncoder(IntEncoder encoder)

  Initializes with the given encoder.

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`

Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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