net.sf.molae.pipe.sorted
Class SelfComparator<T extends Comparable<T>>

java.lang.Object
  extended by net.sf.molae.pipe.sorted.SelfComparator<T>
All Implemented Interfaces:
Comparator<T>

public final class SelfComparator<T extends Comparable<T>>
extends Object
implements Comparator<T>

Compares two objects using their natural ordering.

Since:
2.0

Method Summary
 int compare(T o1, T o2)
          Forwards the comparison request to the first argument.
static
<T extends Comparable<T>>
Comparator<T>
getInstance()
           
 
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
 

Method Detail

getInstance

public static <T extends Comparable<T>> Comparator<T> getInstance()

compare

public int compare(T o1,
                   T o2)
Forwards the comparison request to the first argument.

Specified by:
compare in interface Comparator<T extends Comparable<T>>
Throws:
NullPointerException - if either argument is null.
ClassCastException - if o1 and o2 cannot be compared to one another using natural ordering.