org.gjt.rec.util
Class ToStringComparator

java.lang.Object
  |
  +--org.gjt.rec.util.ToStringComparator
All Implemented Interfaces:
Comparator

public final class ToStringComparator
extends Object
implements Comparator

Comparator that uses the toString() methods of objects to compare them. This class is a Singleton.

Author:
Neil Stockbridge

Field Summary
static String REVISION
           
 
Method Summary
 int compare(Object o1, Object o2)
           
static ToStringComparator onlyInstance()
           
 
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
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Method Detail

onlyInstance

public static ToStringComparator onlyInstance()
Returns:
The only instance of this class allowed in the VM.

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator