org.apache.accumulo.core.client.lexicoder
Class ReverseLexicoder<T>
java.lang.Object
org.apache.accumulo.core.client.lexicoder.ReverseLexicoder<T>
- All Implemented Interfaces:
- Encoder<T>, Lexicoder<T>, TypedValueCombiner.Encoder<T>
public class ReverseLexicoder<T>
- extends Object
- implements Lexicoder<T>
A lexicoder that flips the sort order from another lexicoder. If this is applied to DateLexicoder
, the most recent date will be sorted first and the
oldest date will be sorted last. If it's applied to LongLexicoder
, the Long.MAX_VALUE will be sorted first and Long.MIN_VALUE will be sorted last,
etc...
- Since:
- 1.6.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReverseLexicoder
public ReverseLexicoder(Lexicoder<T> lexicoder)
- Parameters:
lexicoder
- The lexicoder who's sort order will be flipped.
encode
public byte[] encode(T data)
- Specified by:
encode
in interface TypedValueCombiner.Encoder<T>
decode
public T decode(byte[] data)
- Specified by:
decode
in interface TypedValueCombiner.Encoder<T>
Copyright © 2015 Apache Accumulo Project. All rights reserved.