|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgnu.trove.TLinkedList.IteratorImpl
protected final class TLinkedList.IteratorImpl
A ListIterator that supports additions and deletions.
| Field Summary | |
|---|---|
private TLinkable |
_lastReturned
|
private TLinkable |
_next
|
private int |
_nextIndex
|
| Constructor Summary | |
|---|---|
TLinkedList.IteratorImpl(int position)
Creates a new Iterator instance positioned at
index. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object linkable)
Insert linkable at the current position of the iterator. |
boolean |
hasNext()
True if a call to next() will return an object. |
boolean |
hasPrevious()
True if a call to previous() will return a value. |
java.lang.Object |
next()
Returns the value at the Iterator's index and advances the iterator. |
int |
nextIndex()
returns the index of the next node in the list (the one that would be returned by a call to next()). |
java.lang.Object |
previous()
Returns the value before the Iterator's index and moves the iterator back one index. |
int |
previousIndex()
Returns the previous element's index. |
void |
remove()
Removes the current element in the list and shrinks its size accordingly. |
void |
set(java.lang.Object linkable)
Replaces the current element in the list with linkable |
private void |
swap(TLinkable from,
TLinkable to)
Replace from with to in the list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int _nextIndex
private TLinkable _next
private TLinkable _lastReturned
| Constructor Detail |
|---|
TLinkedList.IteratorImpl(int position)
Iterator instance positioned at
index.
position - an int value| Method Detail |
|---|
public final void add(java.lang.Object linkable)
add in interface java.util.ListIteratorlinkable - an object of type TLinkablepublic final boolean hasNext()
hasNext in interface java.util.IteratorhasNext in interface java.util.ListIteratorboolean valuepublic final boolean hasPrevious()
hasPrevious in interface java.util.ListIteratorboolean valuepublic final java.lang.Object next()
next in interface java.util.Iteratornext in interface java.util.ListIteratorObject value
java.util.NoSuchElementException - if there is no next elementpublic final int nextIndex()
nextIndex in interface java.util.ListIteratorint valuepublic final java.lang.Object previous()
previous in interface java.util.ListIteratorObject value
java.util.NoSuchElementException - if there is no previous element.public final int previousIndex()
previousIndex in interface java.util.ListIteratorint valuepublic final void remove()
remove in interface java.util.Iteratorremove in interface java.util.ListIteratorjava.lang.IllegalStateException - neither next nor previous
have been invoked, or remove or add have been invoked after
the last invocation of next or previous.public final void set(java.lang.Object linkable)
set in interface java.util.ListIteratorlinkable - an object of type TLinkable
private void swap(TLinkable from,
TLinkable to)
from - a TLinkable valueto - a TLinkable value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||