|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.util.collections.CompositeComparator
public class CompositeComparator
Comparator that makes comparison using an ordered list of individual comparators;
Constructor Summary | |
---|---|
CompositeComparator(java.util.Comparator[] cmp)
Creates a new CompositeComparator. |
|
CompositeComparator(java.util.Comparator[] cmp,
boolean reverse)
Creates a new CompositeComparator. |
|
CompositeComparator(int size)
Creates an empty CompositeComparator with the given capacity. |
|
CompositeComparator(int size,
boolean reverse)
Creates an empty CompositeComparator with the given capacity. |
Method Summary | |
---|---|
void |
add(java.util.Comparator c)
Adds an additional comparator to this composite. |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
|
boolean |
remove(java.util.Comparator c)
Removes a comparator from this composite. |
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 |
Constructor Detail |
---|
public CompositeComparator(int size)
size
- the starting capacity of this comparatorpublic CompositeComparator(int size, boolean reverse)
size
- the starting capacity of this comparatorreverse
- when true, reverses the sort order of the included
comparators, when false, objects are sorted as usualpublic CompositeComparator(java.util.Comparator[] cmp)
cmp
- the constituent comparators of this compositepublic CompositeComparator(java.util.Comparator[] cmp, boolean reverse)
cmp
- the constituent comparators of this compositereverse
- when true, reverses the sort order of the included
comparators, when false, objects are sorted as usualMethod Detail |
---|
public void add(java.util.Comparator c)
c
- the Comparator to addpublic boolean remove(java.util.Comparator c)
c
- the Comparator to remove
public int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
Comparator.compare(java.lang.Object, java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |