| Method from java.util.LinkedList$ListItr Detail: |
public void add(E e) {
checkForComodification();
lastReturned = header;
addBefore(e, next);
nextIndex++;
expectedModCount++;
}
|
final void checkForComodification() {
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
}
|
public boolean hasNext() {
return nextIndex != size;
}
|
public boolean hasPrevious() {
return nextIndex != 0;
}
|
public E next() {
checkForComodification();
if (nextIndex == size)
throw new NoSuchElementException();
lastReturned = next;
next = next.next;
nextIndex++;
return lastReturned.element;
}
|
public int nextIndex() {
return nextIndex;
}
|
public E previous() {
if (nextIndex == 0)
throw new NoSuchElementException();
lastReturned = next = next.previous;
nextIndex--;
checkForComodification();
return lastReturned.element;
}
|
public int previousIndex() {
return nextIndex-1;
}
|
public void remove() {
checkForComodification();
Entry< E > lastNext = lastReturned.next;
try {
LinkedList.this.remove(lastReturned);
} catch (NoSuchElementException e) {
throw new IllegalStateException();
}
if (next==lastReturned)
next = lastNext;
else
nextIndex--;
lastReturned = header;
expectedModCount++;
}
|
public void set(E e) {
if (lastReturned == header)
throw new IllegalStateException();
checkForComodification();
lastReturned.element = e;
}
|