|
||||||||||
| 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
nl.knowledgeplaza.util.collection.SortedList
public class SortedList
A sorted list based on ArrayList using binary search algorithmes. Force inserts (add and set with an index) are forbidden.
| Field Summary | |
|---|---|
static java.lang.String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
SortedList(java.util.Comparator comparator)
|
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)
insert in a sorted way, use binary search to determine where |
void |
add(java.lang.Object o,
int idx)
Throws an IllegalArgumentException |
boolean |
addAll(java.util.Collection c)
|
java.util.Comparator |
getComparator()
Comparator |
int |
indexOf(java.lang.Object o)
Using binary search (contains need not be overridden since it uses indexOf) |
boolean |
remove(java.lang.Object o)
Using binary search (via indexOf) |
boolean |
removeAll(java.util.Collection c)
Using binary search (via remove) |
java.lang.Object |
set(int idx,
java.lang.Object o)
Throws an IllegalArgumentException |
void |
setComparator(java.util.Comparator comparator)
|
| Methods inherited from class java.util.ArrayList |
|---|
add, addAll, clear, clone, contains, ensureCapacity, get, isEmpty, lastIndexOf, remove, removeRange, 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, 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, retainAll, subList |
| Field Detail |
|---|
public static final java.lang.String SOURCECODE_VERSION
| Constructor Detail |
|---|
public SortedList(java.util.Comparator comparator)
| Method Detail |
|---|
public java.util.Comparator getComparator()
getComparator in interface SortedCollectionpublic void setComparator(java.util.Comparator comparator)
setComparator in interface SortedCollectionpublic 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(java.lang.Object o,
int idx)
o - idx -
public java.lang.Object set(int idx,
java.lang.Object o)
set in interface java.util.Listset in class java.util.ArrayListidx - o - public boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.ListaddAll in class java.util.ArrayListpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.ListindexOf in class java.util.ArrayListpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Listremove in class java.util.ArrayListpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.ListremoveAll in class java.util.AbstractCollection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||