java.util
final class: Vector.ListItr [javadoc |
source]
java.lang.Object
java.util.Vector$Itr
java.util.Vector$ListItr
All Implemented Interfaces:
ListIterator, Iterator
An optimized version of AbstractList.ListItr
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.util.Vector$ListItr Detail: |
public void add(E e) {
int i = cursor;
synchronized (Vector.this) {
checkForComodification();
Vector.this.add(i, e);
expectedModCount = modCount;
}
cursor = i + 1;
lastRet = -1;
}
|
public boolean hasPrevious() {
return cursor != 0;
}
|
public int nextIndex() {
return cursor;
}
|
public E previous() {
synchronized (Vector.this) {
checkForComodification();
int i = cursor - 1;
if (i < 0)
throw new NoSuchElementException();
cursor = i;
return elementData(lastRet = i);
}
}
|
public int previousIndex() {
return cursor - 1;
}
|
public void set(E e) {
if (lastRet == -1)
throw new IllegalStateException();
synchronized (Vector.this) {
checkForComodification();
Vector.this.set(lastRet, e);
}
}
|