org.garret.perst
Class PersistentComparator<T extends IPersistent>

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

public abstract class PersistentComparator<T extends IPersistent>
extends Persistent

Base class for persistent comparator used in SortedCollection class

See Also:
Serialized Form

Constructor Summary
PersistentComparator()
           
 
Method Summary
abstract  int compareMembers(T m1, T m2)
          Compare two members of collection
abstract  int compareMemberWithKey(T 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(T m1,
                                   T 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(T 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