public class MultiDimComparator<T extends MultiDimComparable<? super T>>
extends java.lang.Object
implements java.util.Comparator<T>
MultiDimComparable and the classic
Comparator in Java. Precisely, this is
an implementation of Comparator, which compares
two MultiDimComparable objects in the dimension given in
the constructor. Method compare(o1, o2) simply calls
o1.compareTo(o2,i), where i is the index given
in the constructor.| Constructor and Description |
|---|
MultiDimComparator(int i)
Constructs a comparator, where i is the dimension
used in the comparisons.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(T o1,
T o2)
Calls o1.compareTo(o2, i) from class
MultiDimComparable. |
public MultiDimComparator(int i)
i - index used for comparisonpublic int compare(T o1, T o2)
MultiDimComparable.compare in interface java.util.Comparator<T extends MultiDimComparable<? super T>>o1 - first object to compareo2 - second object to compareTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.