Package adams.data
Class SortedList.DefaultComparator
- java.lang.Object
-
- adams.data.SortedList.DefaultComparator
-
- All Implemented Interfaces:
Serializable
,Comparator
- Enclosing class:
- SortedList<T>
public static class SortedList.DefaultComparator extends Object implements Comparator, Serializable
Default comparator that assumes that objects implement theComparable
interface.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Object o1, Object o2)
Compares the two objects.-
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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(Object o1, Object o2)
Compares the two objects.- Specified by:
compare
in interfaceComparator
- Parameters:
o1
- the first objecto2
- the second object- Returns:
- less than zero, zero or greater than zero if o1 is smaller than, equal to or greater than o2 respectively
-
-