org.apache.hadoop.hbase.filter
Class BinaryPrefixComparator
java.lang.Object
org.apache.hadoop.hbase.filter.ByteArrayComparable
org.apache.hadoop.hbase.filter.BinaryPrefixComparator
- All Implemented Interfaces:
- Comparable<byte[]>
@InterfaceAudience.Public
@InterfaceStability.Stable
public class BinaryPrefixComparator
- extends ByteArrayComparable
A comparator which compares against a specified byte array, but only compares
up to the length of this byte array. For the rest it is similar to
BinaryComparator
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BinaryPrefixComparator
public BinaryPrefixComparator(byte[] value)
- Constructor
- Parameters:
value
- value
compareTo
public int compareTo(byte[] value,
int offset,
int length)
- Description copied from class:
ByteArrayComparable
- Special compareTo method for subclasses, to avoid
copying byte[] unnecessarily.
- Specified by:
compareTo
in class ByteArrayComparable
- Parameters:
value
- byte[] to compareoffset
- offset into valuelength
- 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.
toByteArray
public byte[] toByteArray()
- Specified by:
toByteArray
in class ByteArrayComparable
- Returns:
- The comparator serialized using pb
parseFrom
public static BinaryPrefixComparator parseFrom(byte[] pbBytes)
throws DeserializationException
- Parameters:
pbBytes
- A pb serialized BinaryPrefixComparator
instance
- Returns:
- An instance of
BinaryPrefixComparator
made from bytes
- Throws:
DeserializationException
- See Also:
toByteArray()
Copyright © 2015 The Apache Software Foundation. All rights reserved.