it.unimi.dsi.fastutil.shorts
Class AbstractShortComparator
java.lang.Object
it.unimi.dsi.fastutil.shorts.AbstractShortComparator
- All Implemented Interfaces:
- ShortComparator, Comparator<Short>
public abstract class AbstractShortComparator
- extends Object
- implements ShortComparator
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
Method Summary |
abstract int |
compare(short k1,
short k2)
Compares the given primitive types. |
int |
compare(Short ok1,
Short ok2)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractShortComparator
protected AbstractShortComparator()
compare
public int compare(Short ok1,
Short ok2)
- Specified by:
compare
in interface Comparator<Short>
compare
public abstract int compare(short k1,
short k2)
- Description copied from interface:
ShortComparator
- Compares the given primitive types.
- Specified by:
compare
in interface ShortComparator
- 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
Copyright © 2011. All Rights Reserved.