org.helidb.util
Class ComparableComparator<T extends Comparable<T>>

java.lang.Object
  extended by org.helidb.util.ComparableComparator<T>
Type Parameters:
T - The types of objects that this comparator compares.
All Implemented Interfaces:
Serializable, Comparator<T>

public final class ComparableComparator<T extends Comparable<T>>
extends Object
implements Comparator<T>, Serializable

This Comparator compares Comparable objects. I.e, the compare(Comparable, Comparable) method delegates to the compared objects' Comparable.compareTo(Object) function.

Since:
1.1
Author:
Karl Gustafsson
See Also:
Serialized Form
In_jar:
helidb-core

Constructor Summary
ComparableComparator()
           
 
Method Summary
 int compare(T o1, T o2)
          This method delegates to the Comparable.compareTo(Object) method of o1.
 
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(T o1,
                   T o2)
This method delegates to the Comparable.compareTo(Object) method of o1.

Specified by:
compare in interface Comparator<T extends Comparable<T>>