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

java.lang.Objectjava.util.Collections.UnmodifiableIterator
java.util.Collections.UnmodifiableListIterator
- All Implemented Interfaces:
- Iterator, ListIterator
- Enclosing class:
- Collections
- private static final class Collections.UnmodifiableListIterator
- extends Collections.UnmodifiableIterator
- implements ListIterator
- extends Collections.UnmodifiableIterator
The implementation of UnmodifiableList#listIterator().
| Field Summary | |
private ListIterator |
li
The wrapped iterator, stored both here and in the superclass to avoid excessive casting. |
| Constructor Summary | |
(package private) |
Collections.UnmodifiableListIterator(ListIterator li)
Only trusted code creates a wrapper. |
| Method Summary | |
void |
add(java.lang.Object o)
Blocks the addition of an object to the list underlying this iterator. |
boolean |
hasNext()
Tests whether there are still elements to be retrieved from the underlying collection by next(). |
boolean |
hasPrevious()
Tests whether there are still elements to be retrieved from the underlying collection by previous(). |
java.lang.Object |
next()
Obtains the next element in the underlying collection. |
int |
nextIndex()
Find the index of the element that would be returned by a call to next. |
java.lang.Object |
previous()
Obtains the previous element in the underlying list. |
int |
previousIndex()
Find the index of the element that would be returned by a call to previous. |
void |
remove()
Blocks the removal of elements from the underlying collection by the iterator. |
void |
set(java.lang.Object o)
Blocks the replacement of an element in the list underlying this iterator. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.ListIterator |
hasNext, next, remove |
| Field Detail |
li
private final ListIterator li
- The wrapped iterator, stored both here and in the superclass to
avoid excessive casting.
| Constructor Detail |
Collections.UnmodifiableListIterator
Collections.UnmodifiableListIterator(ListIterator li)
- Only trusted code creates a wrapper.
| Method Detail |
add
public void add(java.lang.Object o)
- Blocks the addition of an object to the list underlying this iterator.
This method never returns, throwing an exception instead.
- Specified by:
addin interfaceListIterator
hasPrevious
public boolean hasPrevious()
- Tests whether there are still elements to be retrieved from the
underlying collection by
previous(). When this method returnstrue, an exception will not be thrown on callingprevious().- Specified by:
hasPreviousin interfaceListIterator
nextIndex
public int nextIndex()
- Find the index of the element that would be returned by a call to next.
If
hasNext()returnsfalse, this returns the list size.- Specified by:
nextIndexin interfaceListIterator
previous
public java.lang.Object previous()
- Obtains the previous element in the underlying list.
- Specified by:
previousin interfaceListIterator
previousIndex
public int previousIndex()
- Find the index of the element that would be returned by a call to
previous. If
hasPrevious()returnsfalse, this returns -1.- Specified by:
previousIndexin interfaceListIterator
set
public void set(java.lang.Object o)
- Blocks the replacement of an element in the list underlying this
iterator. This method never returns, throwing an exception instead.
- Specified by:
setin interfaceListIterator
next
public java.lang.Object next()
hasNext
public boolean hasNext()
- Tests whether there are still elements to be retrieved from the
underlying collection by
next(). When this method returnstrue, an exception will not be thrown on callingnext().
remove
public void remove()
- Blocks the removal of elements from the underlying collection by the
iterator.
|
|||||||||
| Home >> All >> java >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC