java.lang.Objectorg.apache.commons.collections.list.AbstractLinkedList
org.apache.commons.collections.list.CursorableLinkedList
All Implemented Interfaces:
Serializable, List
List implementation with a ListIterator that
allows concurrent modifications to the underlying list.
This implementation supports all of the optional List operations.
It extends AbstractLinkedList and thus provides the
stack/queue/dequeue operations available in java.util.LinkedList .
The main feature of this class is the ability to modify the list and the
iterator at the same time. Both the #listIterator() and #cursor()
methods provides access to a Cursor instance which extends
ListIterator. The cursor allows changes to the list concurrent
with changes to the iterator. Note that the #iterator() method and
sublists do not provide this cursor behaviour.
The Cursor class is provided partly for backwards compatibility
and partly because it allows the cursor to be directly closed. Closing the
cursor is optional because references are held via a WeakReference.
For most purposes, simply modify the iterator and list at will, and then let
the garbage collector to the rest.
Note that this implementation is not synchronized.
Commons - Collections 1.0$ - Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $Rodney - WaldhoffJanek - BoguckiSimon - KitchingStephen - Colebourne| Nested Class Summary: | ||
|---|---|---|
| public static class | CursorableLinkedList.Cursor | An extended ListIterator that allows concurrent changes to
the underlying list. |
| protected static class | CursorableLinkedList.SubCursor | A cursor for the sublist based on LinkedSubListIterator. |
| Field Summary | ||
|---|---|---|
| protected transient List | cursors | A list of the cursor currently open on this list |
| Fields inherited from org.apache.commons.collections.list.AbstractLinkedList: |
|---|
| header, size, modCount |
| Constructor: |
|---|
|
|
| Method from org.apache.commons.collections.list.CursorableLinkedList Summary: |
|---|
| addNode, broadcastNodeChanged, broadcastNodeInserted, broadcastNodeRemoved, createSubListListIterator, cursor, cursor, init, iterator, listIterator, listIterator, registerCursor, removeAllNodes, removeNode, unregisterCursor, updateNode |
| Methods from org.apache.commons.collections.list.AbstractLinkedList: |
|---|
| add, add, addAll, addAll, addFirst, addLast, addNode, addNodeAfter, addNodeBefore, clear, contains, containsAll, createHeaderNode, createNode, createSubListIterator, createSubListListIterator, doReadObject, doWriteObject, equals, get, getFirst, getLast, getNode, hashCode, indexOf, init, isEmpty, isEqualValue, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllNodes, removeFirst, removeLast, removeNode, retainAll, set, size, subList, toArray, toArray, toString, updateNode |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.apache.commons.collections.list.CursorableLinkedList Detail: |
|---|
|
|
|
|
|
A The cursor enables iteration and list changes to occur in any order without invalidating the iterator (from one thread). When elements are added to the list, an event is fired to all active cursors enabling them to adjust to the change in the list. When the "current" (i.e., last returned by ListIterator#next or ListIterator#previous ) element of the list is removed, the cursor automatically adjusts to the change (invalidating the last returned value such that it cannot be removed).
The #listIterator() method returns the same as this method, and can
be cast to a |
A The cursor enables iteration and list changes to occur in any order without invalidating the iterator (from one thread). When elements are added to the list, an event is fired to all active cursors enabling them to adjust to the change in the list. When the "current" (i.e., last returned by ListIterator#next or ListIterator#previous ) element of the list is removed, the cursor automatically adjusts to the change (invalidating the last returned value such that it cannot be removed).
The #listIterator(int) method returns the same as this method, and can
be cast to a |
readObject. |
If the underlying list is modified while iterating using this iterator a ConcurrentModificationException will occur. The cursor behaviour is available via #listIterator() . |
The cursor enables iteration and list changes to occur in any order without invalidating the iterator (from one thread). When elements are added to the list, an event is fired to all active cursors enabling them to adjust to the change in the list. When the "current" (i.e., last returned by ListIterator#next or ListIterator#previous ) element of the list is removed, the cursor automatically adjusts to the change (invalidating the last returned value such that it cannot be removed). |
The cursor enables iteration and list changes to occur in any order without invalidating the iterator (from one thread). When elements are added to the list, an event is fired to all active cursors enabling them to adjust to the change in the list. When the "current" (i.e., last returned by ListIterator#next or ListIterator#previous ) element of the list is removed, the cursor automatically adjusts to the change (invalidating the last returned value such that it cannot be removed). |
|
|
|
|
|