gnu.trove
protected final class TLinkedList.IteratorImpl extends Object implements ListIterator
Field Summary | |
---|---|
TLinkable | _lastReturned |
TLinkable | _next |
int | _nextIndex |
Constructor Summary | |
---|---|
IteratorImpl(int position)
Creates a new Iterator instance positioned at
index.
|
Method Summary | |
---|---|
void | add(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.
|
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()).
|
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(Object linkable)
Replaces the current element in the list with
linkable
|
void | swap(TLinkable from, TLinkable to)
Replace from with to in the list.
|
Iterator
instance positioned at
index.
Parameters: position an int
value
Parameters: linkable an object of type TLinkable
Returns: a boolean
value
Returns: a boolean
value
Returns: an Object
value
Throws: NoSuchElementException if there is no next element
Returns: an int
value
Returns: an Object
value
Throws: NoSuchElementException if there is no previous element.
Returns: an int
value
Throws: IllegalStateException neither next nor previous have been invoked, or remove or add have been invoked after the last invocation of next or previous.
Parameters: linkable an object of type TLinkable
Parameters: from a TLinkable
value to a TLinkable
value