|
|||||||||
| Home >> All >> java >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.util
Class LinkedList.LinkedListItr

java.lang.Objectjava.util.LinkedList.LinkedListItr
- All Implemented Interfaces:
- Iterator, ListIterator
- Enclosing class:
- LinkedList
- private final class LinkedList.LinkedListItr
- extends java.lang.Object
- implements ListIterator
- extends java.lang.Object
A ListIterator over the list. This class keeps track of its position in the list and the two list entries it is between.
| Field Summary | |
private int |
knownMod
Number of modifications we know about. |
private LinkedList.Entry |
lastReturned
Entry that will be affected by remove() or set(). |
private LinkedList.Entry |
next
Entry that will be returned by next(). |
private int |
position
Index of `next'. |
private LinkedList.Entry |
previous
Entry that will be returned by previous(). |
| Constructor Summary | |
(package private) |
LinkedList.LinkedListItr(int index)
Initialize the iterator. |
| Method Summary | |
void |
add(java.lang.Object o)
Adds an element between the previous and next, and advance to the next. |
private void |
checkMod()
Checks for iterator consistency. |
boolean |
hasNext()
Returns true if more elements exist via next. |
boolean |
hasPrevious()
Returns true if more elements exist via previous. |
java.lang.Object |
next()
Returns the next element. |
int |
nextIndex()
Returns the index of the next element. |
java.lang.Object |
previous()
Returns the previous element. |
int |
previousIndex()
Returns the index of the previous element. |
void |
remove()
Remove the most recently returned element from the list. |
void |
set(java.lang.Object o)
Changes the contents of the element most recently returned. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
knownMod
private int knownMod
- Number of modifications we know about.
next
private LinkedList.Entry next
- Entry that will be returned by next().
previous
private LinkedList.Entry previous
- Entry that will be returned by previous().
lastReturned
private LinkedList.Entry lastReturned
- Entry that will be affected by remove() or set().
position
private int position
- Index of `next'.
| Constructor Detail |
LinkedList.LinkedListItr
LinkedList.LinkedListItr(int index)
- Initialize the iterator.
| Method Detail |
checkMod
private void checkMod()
- Checks for iterator consistency.
nextIndex
public int nextIndex()
- Returns the index of the next element.
- Specified by:
nextIndexin interfaceListIterator
previousIndex
public int previousIndex()
- Returns the index of the previous element.
- Specified by:
previousIndexin interfaceListIterator
hasNext
public boolean hasNext()
- Returns true if more elements exist via next.
- Specified by:
hasNextin interfaceListIterator
hasPrevious
public boolean hasPrevious()
- Returns true if more elements exist via previous.
- Specified by:
hasPreviousin interfaceListIterator
next
public java.lang.Object next()
- Returns the next element.
- Specified by:
nextin interfaceListIterator
previous
public java.lang.Object previous()
- Returns the previous element.
- Specified by:
previousin interfaceListIterator
remove
public void remove()
- Remove the most recently returned element from the list.
- Specified by:
removein interfaceListIterator
add
public void add(java.lang.Object o)
- Adds an element between the previous and next, and advance to the next.
- Specified by:
addin interfaceListIterator
set
public void set(java.lang.Object o)
- Changes the contents of the element most recently returned.
- Specified by:
setin interfaceListIterator
|
|||||||||
| Home >> All >> java >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
java.util.LinkedList.LinkedListItr