it.unimi.dsi.fastutil.doubles
Class AbstractDoubleComparator
java.lang.Object
it.unimi.dsi.fastutil.doubles.AbstractDoubleComparator
- All Implemented Interfaces:
- Comparator, DoubleComparator
- public abstract class AbstractDoubleComparator
- extends Object
- implements DoubleComparator
An abstract class facilitating the creation of type-specific comparators.
To create a type-specific comparator you need both a method comparing
primitive types and a method comparing objects. However, if you have the
first one you can just inherit from this class and get for free the second
one.
- See Also:
Comparator
compare
public int compare(Object ok1,
Object ok2)
- Specified by:
compare
in interface Comparator
compare
public abstract int compare(double k1,
double k2)
- Description copied from interface:
DoubleComparator
- Compares the given primitive types.
- Specified by:
compare
in interface DoubleComparator
- Returns:
- A positive integer, zero, or a negative integer if the first
argument is greater than, equal to, or smaller than, respectively, the
second one.
- See Also:
Comparator