|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.palo.api.impl.utils.ArrayListInt.Iterator
org.palo.api.impl.utils.ArrayListInt.ListIterator
public class ArrayListInt.ListIterator
ArrayListInt.ListIterator is a bidirectional iterator with basic versioning. This versioning functionality will warn when the arraylist the iterator is associated with has been modified since the point in time when the iterator was instanciated. However this mechanism implemented by a simple counter is not sufficient for detecting shared-memory modifications done by concurrently executing threads. This is only possible to achieve by using synchronization constructs throughout the usage of the list/iterator pair, as the synchronization constructs are the only way of making sure that the independant working memory of each thread is flushed back into main memory. The ArrayListInt.ListIterator iterator is capable of iterating backwards and forwards through the arraylist it is associated with.
Method Summary | |
---|---|
boolean |
hasNext()
Tests whether there is a next element after the current element that the iterator points to. |
boolean |
hasPrevious()
Tests whether there is a previous element before the current element that the iterator points to. |
int |
next()
Returns the next element from the iterator. |
int |
nextIndex()
Returns the index of the next element in the arraylist. |
int |
previous()
Returns the previous element from the iterator. |
int |
previousIndex()
Returns the index of the previous element in the arraylist. |
void |
set(int element)
Sets the element at which the iterator is currently pointing. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int nextIndex()
ListModifiedException
- thrown if a
modification of the array was detected.public int previousIndex()
ListModifiedException
- thrown if a
modification of the array was detected.public boolean hasPrevious()
ListModifiedException
- thrown if a
modification of the array was detected.public boolean hasNext()
hasNext
in class ArrayListInt.Iterator
ListModifiedException
- thrown if a
modification of the array was detected.public int previous()
ListModifiedException
- thrown if a
modification of the array was detected.public int next()
next
in class ArrayListInt.Iterator
ListModifiedException
- thrown if a
modification of the array was detected.public void set(int element)
element
- the value to set at the current position.
ListModifiedException
- thrown if a
modification of the array was detected.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |