Package org.apache.hadoop.hbase.filter
Class ByteArrayComparable
java.lang.Object
org.apache.hadoop.hbase.filter.ByteArrayComparable
- All Implemented Interfaces:
Comparable<byte[]>
- Direct Known Subclasses:
BigDecimalComparator
,BinaryComparator
,BinaryComponentComparator
,BinaryPrefixComparator
,BitComparator
,LongComparator
,NullComparator
,RegexStringComparator
,SubstringComparator
Base class for byte array comparators
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) boolean
Return 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) abstract int
compareTo
(byte[] value, int offset, int length) Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.int
compareTo
(ByteBuffer value, int offset, int length) Special compareTo method for subclasses, to avoid copying bytes unnecessarily.byte[]
getValue()
static ByteArrayComparable
parseFrom
(byte[] pbBytes) Parse a serialized representation ofByteArrayComparable
abstract byte[]
Returns The comparator serialized using pb
-
Field Details
-
value
byte[] value
-
-
Constructor Details
-
ByteArrayComparable
Constructor.- Parameters:
value
- the value to compare against
-
-
Method Details
-
getValue
-
toByteArray
Returns The comparator serialized using pb -
parseFrom
Parse a serialized representation ofByteArrayComparable
- Parameters:
pbBytes
- A pb serializedByteArrayComparable
instance- Returns:
- An instance of
ByteArrayComparable
made frombytes
- Throws:
DeserializationException
- See Also:
-
areSerializedFieldsEqual
Return true if and only if the fields of the comparator that are serialized are equal to the corresponding fields in other. -
compareTo
- Specified by:
compareTo
in interfaceComparable<byte[]>
-
compareTo
Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.- 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.
-
compareTo
Special compareTo method for subclasses, to avoid copying bytes unnecessarily.- Parameters:
value
- bytes to compare within a ByteBufferoffset
- 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.
-