Class UIntegerLexicoder

java.lang.Object
org.apache.accumulo.core.client.lexicoder.AbstractEncoder<T>
org.apache.accumulo.core.client.lexicoder.impl.AbstractLexicoder<Integer>
org.apache.accumulo.core.client.lexicoder.UIntegerLexicoder
All Implemented Interfaces:
Encoder<Integer>, Lexicoder<Integer>, org.apache.accumulo.core.iterators.TypedValueCombiner.Encoder<Integer>

public class UIntegerLexicoder extends org.apache.accumulo.core.client.lexicoder.impl.AbstractLexicoder<Integer>
A lexicoder for an unsigned integer. It sorts 0 before -1 and does not preserve the native sort order of a Java integer because Java does not contain an unsigned integer. If Java had an unsigned integer type, this would correspond to its sort order.
Since:
1.6.0
  • Constructor Details

    • UIntegerLexicoder

      public UIntegerLexicoder()
  • Method Details

    • encode

      public byte[] encode(Integer i)
    • decode

      public Integer decode(byte[] b)
      Specified by:
      decode in interface org.apache.accumulo.core.iterators.TypedValueCombiner.Encoder<Integer>
      Overrides:
      decode in class AbstractEncoder<Integer>
    • decodeUnchecked

      protected Integer decodeUnchecked(byte[] data, int offset, int len)
      Description copied from class: AbstractEncoder
      Decodes a byte array without checking if the offset and len exceed the bounds of the actual array.
      Specified by:
      decodeUnchecked in class AbstractEncoder<Integer>