|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
org.openbp.common.util.SortingArrayList
public class SortingArrayList
Array list that sorts its contents.
If the setAutoSort(boolean) property is set to true, the list will sort after any add operation to the list.
Otherwise, the sort() method must be called.
The list will use the comparator
You may set the sorter using setComparator(java.util.Comparator) method.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
SortingArrayList()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.Object element)
|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int index,
java.util.Collection c)
|
protected void |
autoSort()
Invokes the automatic sorting if enabled. |
java.util.Comparator |
getComparator()
Gets the element comparator. |
boolean |
isAutoSort()
Gets the auto sort property. |
void |
setAutoSort(boolean autoSort)
Sets the auto sort property. |
void |
setComparator(java.util.Comparator comparator)
Sets the element comparator. |
void |
sort()
Sorts the list. |
| Methods inherited from class java.util.ArrayList |
|---|
clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Constructor Detail |
|---|
public SortingArrayList()
| Method Detail |
|---|
public java.util.Comparator getComparator()
public void setComparator(java.util.Comparator comparator)
public boolean isAutoSort()
public void setAutoSort(boolean autoSort)
public void sort()
protected void autoSort()
public boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Listadd in class java.util.ArrayList
public void add(int index,
java.lang.Object element)
add in interface java.util.Listadd in class java.util.ArrayListpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.ListaddAll in class java.util.ArrayList
public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.ListaddAll in class java.util.ArrayList
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||