org.apache.hadoop.hbase.filter
Class WritableByteArrayComparable

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.WritableByteArrayComparable
All Implemented Interfaces:
Comparable<byte[]>, org.apache.hadoop.io.Writable
Direct Known Subclasses:
BinaryComparator, BinaryPrefixComparator, BitComparator, NullComparator, RegexStringComparator, SubstringComparator

public abstract class WritableByteArrayComparable
extends Object
implements org.apache.hadoop.io.Writable, Comparable<byte[]>

Base class, combines Comparable and Writable.


Constructor Summary
WritableByteArrayComparable()
          Nullary constructor, for Writable
WritableByteArrayComparable(byte[] value)
          Constructor.
 
Method Summary
 int compareTo(byte[] value)
           
abstract  int compareTo(byte[] value, int offset, int length)
          Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.
 byte[] getValue()
           
 void readFields(DataInput in)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WritableByteArrayComparable

public WritableByteArrayComparable()
Nullary constructor, for Writable


WritableByteArrayComparable

public WritableByteArrayComparable(byte[] value)
Constructor.

Parameters:
value - the value to compare against
Method Detail

getValue

public byte[] getValue()

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

compareTo

public int compareTo(byte[] value)
Specified by:
compareTo in interface Comparable<byte[]>

compareTo

public abstract int compareTo(byte[] value,
                              int offset,
                              int length)
Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.

Parameters:
value - byte[] to compare
offset - offset into value
length - 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.