org.apache.hadoop.hbase.filter
Class BitComparator
java.lang.Object
org.apache.hadoop.hbase.filter.ByteArrayComparable
org.apache.hadoop.hbase.filter.BitComparator
- All Implemented Interfaces:
- Comparable<byte[]>
@InterfaceAudience.Public
@InterfaceStability.Stable
public class BitComparator
- extends ByteArrayComparable
A bit comparator which performs the specified bitwise operation on each of the bytes
with the specified byte array. Then returns whether the result is non-zero.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bitOperator
protected BitComparator.BitwiseOp bitOperator
BitComparator
public BitComparator(byte[] value,
BitComparator.BitwiseOp bitOperator)
- Constructor
- Parameters:
value
- valuebitOperator
- operator to use on the bit comparison
getOperator
public BitComparator.BitwiseOp getOperator()
- Returns:
- the bitwise operator
toByteArray
public byte[] toByteArray()
- Specified by:
toByteArray
in class ByteArrayComparable
- Returns:
- The comparator serialized using pb
parseFrom
public static BitComparator parseFrom(byte[] pbBytes)
throws DeserializationException
- Parameters:
pbBytes
- A pb serialized BitComparator
instance
- Returns:
- An instance of
BitComparator
made from bytes
- Throws:
DeserializationException
- See Also:
toByteArray()
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.
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.