Package org.jppf.utils.collections
Class DescendingIntegerComparator
java.lang.Object
org.jppf.utils.collections.DescendingIntegerComparator
- All Implemented Interfaces:
Comparator<Integer>
This comparator defines a descending value order for integers.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
DescendingIntegerComparator
public DescendingIntegerComparator()
-
-
Method Details
-
compare
Compare two integers. This comparator defines a descending order for integers.- Specified by:
comparein interfaceComparator<Integer>- Parameters:
o1- first integer to compare.o2- second integer to compare.- Returns:
- -1 if o1 > o2, 0 if o1 == o2, 1 if o1 < o2
-
main
To quickly test this comparator.- Parameters:
args- not used.
-