|
||||||||||
| 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<T>
nl.knowledgeplaza.util.collection.SortedList<T>
public class SortedList<T>
A sorted list based on ArrayList using binary search algorithmes. Force inserts (add and set with an index) are forbidden.
| Field Summary | |
|---|---|
static String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
SortedList(Comparator<T> comparator)
|
|
| Method Summary | |
|---|---|
boolean |
add(T o)
insert in a sorted way, use binary search to determine where |
void |
add(T o,
int idx)
Throws an IllegalArgumentException |
boolean |
addAll(Collection<? extends T> c)
|
Comparator<? super T> |
getComparator()
Comparator |
int |
indexOf(Object o)
Using binary search (contains need not be overridden since it uses indexOf) |
boolean |
remove(Object o)
Using binary search (via indexOf) |
boolean |
removeAll(Collection<?> c)
Using binary search (via remove) |
T |
set(int idx,
T o)
Throws an IllegalArgumentException |
void |
setComparator(Comparator<? super T> 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 String SOURCECODE_VERSION
| Constructor Detail |
|---|
public SortedList(Comparator<T> comparator)
| Method Detail |
|---|
public Comparator<? super T> getComparator()
getComparator in interface SortedCollection<T>public void setComparator(Comparator<? super T> comparator)
setComparator in interface SortedCollection<T>public boolean add(T o)
add in interface Collection<T>add in interface List<T>add in class ArrayList<T>
public void add(T o,
int idx)
o - idx -
public T set(int idx,
T o)
set in interface List<T>set in class ArrayList<T>idx - o - public boolean addAll(Collection<? extends T> c)
addAll in interface Collection<T>addAll in interface List<T>addAll in class ArrayList<T>public int indexOf(Object o)
indexOf in interface List<T>indexOf in class ArrayList<T>public boolean remove(Object o)
remove in interface Collection<T>remove in interface List<T>remove in class ArrayList<T>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<T>removeAll in interface List<T>removeAll in class AbstractCollection<T>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||