Package adams.core
Class DefaultCompare
- java.lang.Object
-
- adams.core.DefaultCompare
-
- All Implemented Interfaces:
Serializable
,Comparator<Comparable>
public class DefaultCompare extends Object implements Comparator<Comparable>, Serializable
Compares twoComparable
objects.- Version:
- $Revision: 4584 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultCompare()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Comparable o1, Comparable o2)
Compares its two arguments for order.boolean
equals(Object obj)
Indicates whether some other object is "equal to" this Comparator.String
globalInfo()
Returns a string describing the object.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Returns:
- a description suitable for displaying in the gui
-
compare
public int compare(Comparable o1, Comparable o2)
Compares its two arguments for order.- Specified by:
compare
in interfaceComparator<Comparable>
- Parameters:
o1
- the first objecto2
- the second object- Returns:
- -1 if o1<o2, 0 if o1=o2 and 1 if o1&;gt;o2
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this Comparator.- Specified by:
equals
in interfaceComparator<Comparable>
- Overrides:
equals
in classObject
- Parameters:
obj
- the object to compare with this Comparator- Returns:
- true if the object is a DefaultCompare object as well
-
-