jdbm.helper
Class ByteArrayComparator
java.lang.Object
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
|
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 |
ByteArrayComparator
public ByteArrayComparator()
compare
public int compare(byte[] obj1,
byte[] obj2)
- Compare two objects.
- Specified by:
compare in interface Comparator<byte[]>
- Parameters:
obj1 - First objectobj2 - 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.