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.


Field Summary
(package private) static boolean debug
           
private  java.util.Vector items
           
private  arlut.csd.Util.Compare secondaryComparator
           
 
Constructor Summary
FixedListCompare(java.util.Vector items, arlut.csd.Util.Compare secondaryComparator)
           
 
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, toString, wait, wait, wait
 

Field Detail

debug

static final boolean debug
See Also:
Constant Field Values

items

private java.util.Vector items

secondaryComparator

private arlut.csd.Util.Compare secondaryComparator
Constructor Detail

FixedListCompare

public FixedListCompare(java.util.Vector items,
                        arlut.csd.Util.Compare secondaryComparator)
Parameters:
items - A list of items whose sort order we will impart on comparisons
secondaryComparator - A Compare object that we will pass objects to that are both missing from the items list.
Method Detail

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