|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.AbstractSequentialList
java.util.LinkedList
com.tensegrity.generic.util.NonRandomAccessLinkedList
A simple linkedlist wrapper that explicitly DISALLOWS random access.
(Random access is accessing the n'th element, which is terribly
inefficient for a linked list). This list is a wrapper to track
such attempts and to avoid them. Performance will greatly benefit
from avoiding such malicious usages of linkedlists.
The contract of NonRandomAccessLinkedList disallows all
random-access and will throw an UnsupportedOperationException if
one occurs.
| Field Summary |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
NonRandomAccessLinkedList()
Constructs a new empty NonRandomAccessLinkedList. |
|
NonRandomAccessLinkedList(java.util.Collection collection)
Constructs a new NonRandomAccessLinkedList that is
initially filled with all the objects that are contained in the
given collection. |
|
| Method Summary | |
boolean |
contains(java.lang.Object o)
Forbidden by NonRandomAccessLinkedLIst contract |
java.lang.Object |
get(int index)
Forbidden by NonRandomAccessLinkedLIst contract |
int |
indexOf(java.lang.Object o)
Forbidden by NonRandomAccessLinkedLIst contract |
int |
lastIndexOf(java.lang.Object o)
Forbidden by NonRandomAccessLinkedLIst contract |
java.lang.Object |
remove(int index)
Forbidden by NonRandomAccessLinkedLIst contract |
boolean |
remove(java.lang.Object o)
Forbidden by NonRandomAccessLinkedLIst contract |
java.lang.Object |
set(int index,
java.lang.Object element)
Forbidden by NonRandomAccessLinkedLIst contract |
| Methods inherited from class java.util.LinkedList |
add, add, addAll, addAll, addFirst, addLast, clear, clone, getFirst, getLast, listIterator, removeFirst, removeLast, size, toArray, toArray |
| Methods inherited from class java.util.AbstractSequentialList |
iterator |
| Methods inherited from class java.util.AbstractList |
equals, hashCode, listIterator, removeRange, subList |
| Methods inherited from class java.util.AbstractCollection |
containsAll, isEmpty, 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, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
| Constructor Detail |
public NonRandomAccessLinkedList(java.util.Collection collection)
NonRandomAccessLinkedList that is
initially filled with all the objects that are contained in the
given collection.
collection - a collection whose values are to put inserted
into the created NonRandomAccessLinkedList instance.public NonRandomAccessLinkedList()
NonRandomAccessLinkedList.
| Method Detail |
public boolean contains(java.lang.Object o)
public java.lang.Object get(int index)
public int indexOf(java.lang.Object o)
public int lastIndexOf(java.lang.Object o)
public java.lang.Object remove(int index)
public boolean remove(java.lang.Object o)
public java.lang.Object set(int index,
java.lang.Object element)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||