Package org.apache.hadoop.hbase.filter
Class BinaryComponentComparator
java.lang.Object
org.apache.hadoop.hbase.filter.ByteArrayComparable
org.apache.hadoop.hbase.filter.BinaryComponentComparator
- All Implemented Interfaces:
Comparable<byte[]>
A comparator which compares against a specified byte array, but only compares specific portion of
the byte array. For the rest it is similar to
BinaryComparator
.-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.filter.ByteArrayComparable
value
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) boolean
Returns true if and only if the fields of the comparator that are serialized are equal to the corresponding fields in other.int
compareTo
(byte[] value) int
compareTo
(byte[] value, int offset, int length) Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.boolean
int
hashCode()
static BinaryComponentComparator
parseFrom
(byte[] pbBytes) Parse a serialized representation ofBinaryComponentComparator
byte[]
Returns The comparator serialized using pbMethods inherited from class org.apache.hadoop.hbase.filter.ByteArrayComparable
compareTo, getValue
-
Field Details
-
offset
-
-
Constructor Details
-
BinaryComponentComparator
Constructor- Parameters:
value
- value of the componentoffset
- offset of the component from begining
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<byte[]>
- Overrides:
compareTo
in classByteArrayComparable
-
compareTo
Description copied from class:ByteArrayComparable
Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.- Specified by:
compareTo
in classByteArrayComparable
- 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.
-
equals
-
hashCode
-
toByteArray
Returns The comparator serialized using pb- Specified by:
toByteArray
in classByteArrayComparable
-
parseFrom
Parse a serialized representation ofBinaryComponentComparator
- Parameters:
pbBytes
- A pb serializedBinaryComponentComparator
instance- Returns:
- An instance of
BinaryComponentComparator
made frombytes
- Throws:
DeserializationException
- if an error occurred- See Also:
-
areSerializedFieldsEqual
Returns true if and only if the fields of the comparator that are serialized are equal to the corresponding fields in other. Used for testing.- Overrides:
areSerializedFieldsEqual
in classByteArrayComparable
-