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 aComparatorfrom the argumentList.ListOrderComparator(T... array)Construct aComparatorfrom the argument array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(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 aComparatorfrom the argumentList.- Parameters:
list- TheListwith the elements in ranked order.
-
ListOrderComparator
@SafeVarargs public ListOrderComparator(T... array)
Construct aComparatorfrom the argument array.- Parameters:
array- The array with the elements in ranked order.
-
-