Package ball.util
Class ListOrderComparator<T>
- java.lang.Object
-
- ball.util.ListOrderComparator<T>
-
- All Implemented Interfaces:
Comparator<T>
public class ListOrderComparator<T> extends Object implements Comparator<T>
- Author:
- Allen D. Ball
-
-
Constructor Summary
Constructors Constructor Description ListOrderComparator(List<T> list)
Construct aComparator
from the argumentList
.ListOrderComparator(T... array)
Construct aComparator
from the argument array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(T left, T right)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
ListOrderComparator
public ListOrderComparator(List<T> list)
Construct aComparator
from the argumentList
.- Parameters:
list
- TheList
with the elements in ranked order.
-
ListOrderComparator
@SafeVarargs public ListOrderComparator(T... array)
Construct aComparator
from the argument array.- Parameters:
array
- The array with the elements in ranked order.
-
-