org.opends.server.backends.jeb
Class EntryContainer.KeyReverseComparator

java.lang.Object
  extended by org.opends.server.backends.jeb.EntryContainer.KeyReverseComparator
All Implemented Interfaces:
java.util.Comparator<byte[]>
Enclosing class:
EntryContainer

public static class EntryContainer.KeyReverseComparator
extends java.lang.Object
implements java.util.Comparator<byte[]>

A lexicographic byte array comparator that compares in reverse byte order. This is used for the dn2id database. If we want to find all the entries in a subtree dc=com we know that all subordinate entries must have ,dc=com as a common suffix. In reversing the order of comparison we turn the subtree base into a common prefix and are able to iterate through the keys having that prefix.


Constructor Summary
EntryContainer.KeyReverseComparator()
           
 
Method Summary
 int compare(byte[] a, byte[] b)
          Compares its two arguments for order.
 
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

EntryContainer.KeyReverseComparator

public EntryContainer.KeyReverseComparator()
Method Detail

compare

public int compare(byte[] a,
                   byte[] b)
Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Specified by:
compare in interface java.util.Comparator<byte[]>
Parameters:
a - the first object to be compared.
b - the second object to be compared.
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.