com.sleepycat.persist.impl
Class PersistComparator

java.lang.Object
  extended by com.sleepycat.persist.impl.PersistComparator
All Implemented Interfaces:
DatabaseComparator, Serializable, Comparator<byte[]>

public class PersistComparator
extends Object
implements DatabaseComparator, Comparator<byte[]>, Serializable

The btree comparator for persistent key classes. The serialized form of this comparator is stored in the BDB JE database descriptor so that the comparator can be re-created during recovery.

Author:
Mark Hayes
See Also:
Serialized Form

Constructor Summary
PersistComparator(PersistKeyBinding binding)
           
 
Method Summary
 int compare(byte[] b1, byte[] b2)
           
 void initialize(ClassLoader loader)
          In BDB JE this method will be called after the comparator is deserialized, including during recovery.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

PersistComparator

public PersistComparator(PersistKeyBinding binding)
Method Detail

initialize

public void initialize(ClassLoader loader)
In BDB JE this method will be called after the comparator is deserialized, including during recovery. We must construct the binding here, without access to the stored catalog since recovery is not complete.

Specified by:
initialize in interface DatabaseComparator
Parameters:
loader - is the environment's ClassLoader property.

compare

public int compare(byte[] b1,
                   byte[] b2)
Specified by:
compare in interface Comparator<byte[]>

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2004-2012 Oracle. All rights reserved.