org.jutil.java.collections
Class ComparableComparator

java.lang.Object
  |
  +--org.jutil.java.collections.ExtendedComparator
        |
        +--org.jutil.java.collections.ComparableComparator
All Implemented Interfaces:
java.util.Comparator

public class ComparableComparator
extends ExtendedComparator

Trivial Comparator that uses the Comparable interface of objects to compare.

Version:
$Revision: 1.2 $
Author:
Tom Schrijvers, Marko van Dooren

Constructor Summary
ComparableComparator()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          public behavior

pre o1 instanceof Comparable;

post \result == ((Comparable)o1).compareTo(o2);
See superclass.
 
Methods inherited from class org.jutil.java.collections.ExtendedComparator
ensureExtended, greater, max, min, notGreater, notSmaller, smaller
 
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

ComparableComparator

public ComparableComparator()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
public behavior

pre o1 instanceof Comparable;

post \result == ((Comparable)o1).compareTo(o2);
See superclass.