org.apache.hadoop.hbase.filter
Class ByteArrayComparable

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.ByteArrayComparable
All Implemented Interfaces:
Comparable<byte[]>
Direct Known Subclasses:
BinaryComparator, BinaryPrefixComparator, BitComparator, LongComparator, NullComparator, RegexStringComparator, SubstringComparator

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class ByteArrayComparable
extends Object
implements Comparable<byte[]>

Base class for byte array comparators


Constructor Summary
ByteArrayComparable(byte[] value)
          Constructor.
 
Method Summary
 int compareTo(byte[] value)
           
abstract  int compareTo(byte[] value, int offset, int length)
          Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.
 byte[] getValue()
           
static ByteArrayComparable parseFrom(byte[] pbBytes)
           
abstract  byte[] toByteArray()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayComparable

public ByteArrayComparable(byte[] value)
Constructor.

Parameters:
value - the value to compare against
Method Detail

getValue

public byte[] getValue()

toByteArray

public abstract byte[] toByteArray()
Returns:
The comparator serialized using pb

parseFrom

public static ByteArrayComparable parseFrom(byte[] pbBytes)
                                     throws DeserializationException
Parameters:
pbBytes - A pb serialized ByteArrayComparable instance
Returns:
An instance of ByteArrayComparable made from bytes
Throws:
DeserializationException
See Also:
toByteArray()

compareTo

public int compareTo(byte[] value)
Specified by:
compareTo in interface Comparable<byte[]>

compareTo

public abstract int compareTo(byte[] value,
                              int offset,
                              int length)
Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.

Parameters:
value - byte[] to compare
offset - offset into value
length - number of bytes to compare
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.


Copyright © 2015 The Apache Software Foundation. All rights reserved.