jdbm.helper
Class ByteArrayComparator

java.lang.Object
  extended by jdbm.helper.ByteArrayComparator
All Implemented Interfaces:
Serializable, Comparator<byte[]>

public final class ByteArrayComparator
extends Object
implements Comparator<byte[]>, Serializable

Comparator for byte arrays.

Author:
Alex Boisvert
See Also:
Serialized Form

Constructor Summary
ByteArrayComparator()
           
 
Method Summary
 int compare(byte[] obj1, byte[] obj2)
          Compare two objects.
static int compareByteArray(byte[] thisKey, byte[] otherKey)
          Compare two byte arrays.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ByteArrayComparator

public ByteArrayComparator()
Method Detail

compare

public int compare(byte[] obj1,
                   byte[] obj2)
Compare two objects.

Specified by:
compare in interface Comparator<byte[]>
Parameters:
obj1 - First object
obj2 - Second object
Returns:
a positive integer if obj1 > obj2, 0 if obj1 == obj2, and a negative integer if obj1 < obj2

compareByteArray

public static int compareByteArray(byte[] thisKey,
                                   byte[] otherKey)
Compare two byte arrays.



Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.