org.garret.perst
Class PersistentComparator

java.lang.Object
  extended byorg.garret.perst.Persistent
      extended byorg.garret.perst.PersistentComparator
All Implemented Interfaces:
java.io.Externalizable, IPersistent, java.io.Serializable

public abstract class PersistentComparator
extends Persistent

Base class for persistent comparator used in SortedCollection class

See Also:
Serialized Form

Constructor Summary
PersistentComparator()
           
 
Method Summary
abstract  int compareMembers(IPersistent m1, IPersistent m2)
          Compare two members of collection
abstract  int compareMemberWithKey(IPersistent mbr, java.lang.Object key)
          Compare member with specified search key
 
Methods inherited from class org.garret.perst.Persistent
assignOid, deallocate, equals, getOid, getStorage, hashCode, invalidate, isDeleted, isModified, isPersistent, isRaw, load, loadAndModify, makePersistent, modify, onLoad, onStore, readExternal, recursiveLoading, store, writeExternal
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentComparator

public PersistentComparator()
Method Detail

compareMembers

public abstract int compareMembers(IPersistent m1,
                                   IPersistent m2)
Compare two members of collection

Parameters:
m1 - first members
m2 - second members
Returns:
negative number if m1 < m2, zero if m1 == m2 and positive number if m1 > m2

compareMemberWithKey

public abstract int compareMemberWithKey(IPersistent mbr,
                                         java.lang.Object key)
Compare member with specified search key

Parameters:
mbr - collection member
key - search key
Returns:
negative number if mbr < key, zero if mbr == key and positive number if mbr > key