|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprefuse.util.collections.CompositeComparator<E>
public class CompositeComparator<E>
Comparator that makes comparison using an ordered list of individual comparators;
Constructor Summary | |
---|---|
CompositeComparator(boolean reverse,
java.util.Comparator<? super E>... cmp)
Creates a new CompositeComparator. |
|
CompositeComparator(java.util.Comparator<? super E>... cmp)
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<? super E> c)
Adds an additional comparator to this composite. |
int |
compare(E o1,
E o2)
|
boolean |
remove(java.util.Comparator<? super E> 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<? super E>... cmp)
cmp
- the constituent comparators of this compositepublic CompositeComparator(boolean reverse, java.util.Comparator<? super E>... cmp)
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<? super E> c)
c
- the Comparator to addpublic boolean remove(java.util.Comparator<? super E> c)
c
- the Comparator to remove
public int compare(E o1, E o2)
compare
in interface java.util.Comparator<E>
Comparator.compare(java.lang.Object, java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |