|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.app.util.ScalableList.ScalableIterator<E>
E - the type of element stored in the ScalableListstatic class ScalableList.ScalableIterator<E>
This class represents an iterator of the elements of the
ScalableList.
| Field Summary | |
|---|---|
protected ManagedReference<ScalableList.ListNode<E>> |
currentNode
The current ListNode of the iterative process |
protected int |
cursor
The iteration location of the list |
protected long |
listNodeReferenceValue
The value for the current ListNode to determine if any
changes have taken place since the last time it was accessed |
(package private) ManagedReference<ScalableList<E>> |
owner
A reference to the ScalableList which this iterator is
referring to |
protected boolean |
wasNextCalled
Flag which only lets one removal happen per call to next() |
| Constructor Summary | |
|---|---|
ScalableList.ScalableIterator(ScalableList<E> list)
Constructor used to create a ScalableListIterator for the
underlying elements in the ScalableList. |
|
ScalableList.ScalableIterator(ScalableList<E> list,
ScalableList.ListNode<E> startingNode)
|
|
| Method Summary | ||
|---|---|---|
(package private) void |
checkDataIntegrity()
Checks whether the data integrity value has changed, and throws a ConcurrentModificationException if so. |
|
(package private) void |
doRemove()
Performs the remove and updates the references if necessary |
|
(package private) int |
getAbsoluteIndex(ScalableList.Node<E> node,
int size)
Walks up the tree and collects the sizes to produce an absolute index. |
|
(package private) int |
getCurrentIndex()
Retrieves the index of the current element by walking up the tree to the root and aggregating the counts of each ListNode and
TreeNode. |
|
protected int |
getCursorBasedOnPreviousAction(boolean next)
Retrieve the index of interest, based on our previous direction and intended direction |
|
boolean |
hasNext()
Returns whether there is a next element to iterate over. |
|
(package private) static
|
isNextWithinRange(int offset,
ScalableList.ListNode<E> currentListNode)
Performs a check to see that the index for next() is still
within range of the sub list. |
|
E |
next()
Retrieves the next element. |
|
void |
remove()
Removes from the underlying collection the last element returned by the iterator. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final ManagedReference<ScalableList<E>> owner
ScalableList which this iterator is
referring to
protected ManagedReference<ScalableList.ListNode<E>> currentNode
ListNode of the iterative process
protected int cursor
protected boolean wasNextCalled
next()
protected long listNodeReferenceValue
ListNode to determine if any
changes have taken place since the last time it was accessed
| Constructor Detail |
|---|
ScalableList.ScalableIterator(ScalableList<E> list)
ScalableListIterator for the
underlying elements in the ScalableList.
list - the ScalableList over which to iterate
ScalableList.ScalableIterator(ScalableList<E> list,
ScalableList.ListNode<E> startingNode)
| Method Detail |
|---|
static <E> boolean isNextWithinRange(int offset,
ScalableList.ListNode<E> currentListNode)
next() is still
within range of the sub list.
E - the type of element storedoffset - the offsetcurrentListNode - the current ListNode being examined
true if the offset exists in the sub list and
false otherwiseint getCurrentIndex()
ListNode and
TreeNode. This operation is slightly expensive because of
the required percolation up the tree.
int getAbsoluteIndex(ScalableList.Node<E> node,
int size)
public E next()
next in interface Iterator<E>ConcurrentModificationException - if the ListNode
that the iterator is pointing to has been modified to (addition or
removal) by someone else
NoSuchElementException - if there is no next elementprotected int getCursorBasedOnPreviousAction(boolean next)
next - whether we intend on travelling in the next
direction; true if so, and false otherwise
void checkDataIntegrity()
ConcurrentModificationException if so.
ConcurrentModificationException - if the data integrity value
has changed or if it cannot be verifiedpublic boolean hasNext()
hasNext in interface Iterator<E>true if there is a next element, or false
otherwise
ConcurrentModificationException - if the ListNode has
been modified or removedpublic void remove()
next.
remove in interface Iterator<E>void doRemove()
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||