arlut.csd.Util
Class FixedListCompare
java.lang.Object
|
+--arlut.csd.Util.FixedListCompare
- All Implemented Interfaces:
- Compare
- public class FixedListCompare
- extends java.lang.Object
- implements Compare
This class implements the Compare
interface, and provides a sort comparator that can sort things
according to a fixed ordering. Items not in the original ordered
list will be placed after items in the original list, and in
alphabetical toString() order relative to each other.
|
Method Summary |
int |
compare(java.lang.Object a,
java.lang.Object b)
Comparator for arlut.csd.Util sort classes. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
debug
static final boolean debug
items
private java.util.Vector items
secondaryComparator
private Compare secondaryComparator
FixedListCompare
public FixedListCompare(java.util.Vector items,
Compare secondaryComparator)
- Parameters:
items - A list of items whose sort order we will impart on comparisonssecondaryComparator - A Compare object that we will pass objects to
that are both missing from the items list.
compare
public int compare(java.lang.Object a,
java.lang.Object b)
- Comparator for arlut.csd.Util sort classes. compare returns
-1 if a < b, 0 if a = b, and 1 if a > b in sort order.
- Specified by:
compare in interface Compare