de.lmu.ifi.dbs.elki.utilities
Class PropertyPermutationComparator<P>
java.lang.Object
de.lmu.ifi.dbs.elki.utilities.PropertyPermutationComparator<P>
- Type Parameters:
P
- the type of the IDPropertyPair to compare
- All Implemented Interfaces:
- Comparator<IDPropertyPair<P>>
public class PropertyPermutationComparator<P>
- extends Object
- implements Comparator<IDPropertyPair<P>>
Provides a comparator for an IDPropertyPair
with property of type P
- Author:
- Arthur Zimek
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
propertyComparator
private Comparator<P> propertyComparator
- A comparator for type P.
PropertyPermutationComparator
public PropertyPermutationComparator(Comparator<P> propertyComparator)
- Provides a comparator for an
IDPropertyPair
based on the given Comparator for type P
.
- Parameters:
propertyComparator
- a Comparator for type P
to base the comparison of an IDPropertyPair
on
compare
public int compare(IDPropertyPair<P> o1,
IDPropertyPair<P> o2)
- To Objects of type
IDPropertyPair
are compared based on the comparison
of their property using the current propertyComparator
.
- Specified by:
compare
in interface Comparator<IDPropertyPair<P>>
- See Also:
Comparator.compare(java.lang.Object, java.lang.Object)