@InterfaceAudience.Public public class BinaryComponentComparator extends ByteArrayComparable
BinaryComparator
.Modifier and Type | Field and Description |
---|---|
private int |
offset |
value
Constructor and Description |
---|
BinaryComponentComparator(byte[] value,
int offset)
Constructor
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
areSerializedFieldsEqual(ByteArrayComparable other) |
int |
compareTo(byte[] value) |
int |
compareTo(byte[] value,
int offset,
int length)
Special compareTo method for subclasses, to avoid
copying byte[] unnecessarily.
|
boolean |
equals(Object other) |
int |
hashCode() |
static BinaryComponentComparator |
parseFrom(byte[] pbBytes) |
byte[] |
toByteArray() |
compareTo, getValue
private int offset
public BinaryComponentComparator(byte[] value, int offset)
value
- value of the componentoffset
- offset of the component from beginingpublic int compareTo(byte[] value)
compareTo
in interface Comparable<byte[]>
compareTo
in class ByteArrayComparable
public int compareTo(byte[] value, int offset, int length)
ByteArrayComparable
compareTo
in class ByteArrayComparable
value
- byte[] to compareoffset
- offset into valuelength
- number of bytes to comparepublic byte[] toByteArray()
toByteArray
in class ByteArrayComparable
public static BinaryComponentComparator parseFrom(byte[] pbBytes) throws DeserializationException
pbBytes
- A pb serialized BinaryComponentComparator
instanceBinaryComponentComparator
made from bytes
DeserializationException
- DeserializationExceptiontoByteArray()
boolean areSerializedFieldsEqual(ByteArrayComparable other)
areSerializedFieldsEqual
in class ByteArrayComparable
other
- paramemter to compare againstCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.