de.lmu.ifi.dbs.elki.utilities
Class IDDoublePairComparatorDescDouble
java.lang.Object
de.lmu.ifi.dbs.elki.utilities.IDDoublePairComparatorDescDouble
- All Implemented Interfaces:
- Comparator<IDDoublePair>
public class IDDoublePairComparatorDescDouble
- extends Object
- implements Comparator<IDDoublePair>
A comparator for IDDoublePairs. The comparator ensures a sorting in
descending double values of the according IDDoublePairs when using
Arrays.sort
- Author:
- Peer Kröger
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IDDoublePairComparatorDescDouble
public IDDoublePairComparatorDescDouble()
compare
public int compare(IDDoublePair o1,
IDDoublePair o2)
- Implements the compare method such that a sorting is in descending order.
- Specified by:
compare
in interface Comparator<IDDoublePair>
- Parameters:
o1
- the first object of type IDDoublePairo2
- the second object of type IDDoublePair
- Returns:
- 1, -1, and zero if the double value of the first IDDoublePair is
greater, less or equal to the double value of the second one.