au.edu.swin.synergy.plugin.userdb
Class BItemSorter
java.lang.Object
|
+--au.edu.swin.synergy.plugin.userdb.BItemSorter
- public class BItemSorter
- extends Object
- implements Comparator
This is used to compare two BPrivileged items to determine
whether the order they should come in. The way in which they
are ordered may be set as either by unique id, or by name.
- Author:
- Tristan Austin
Constructor Summary |
BItemSorter()
Default constructor creates a Comparator with the
sort ids option selected by default. |
BItemSorter(boolean compareIDs)
Creates the Comparator with the compareIDs flag set to
the given value. |
Method Summary |
int |
compare(Object item1,
Object item2)
This will compare the two objects on the assumption. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
BItemSorter
public BItemSorter()
- Default constructor creates a Comparator with the
sort ids option selected by default.
BItemSorter
public BItemSorter(boolean compareIDs)
- Creates the Comparator with the compareIDs flag set to
the given value.
- Parameters:
compareIDs
- True to compare by ids, false to compare by usernames
compare
public int compare(Object item1,
Object item2)
- This will compare the two objects on the assumption. If item1 is
less than item2 it will return a negative number, if it is the same
it will return 0 and if it is greater than the second, it will return a positive
number.
- Specified by:
- compare in interface Comparator
- Parameters:
item1
- The first privilege to compareitem2
- The second item to compare the first one to