Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.util
Class Collections.UnmodifiableListIterator  view Collections.UnmodifiableListIterator download Collections.UnmodifiableListIterator.java

java.lang.Object
  extended byjava.util.Collections.UnmodifiableIterator
      extended byjava.util.Collections.UnmodifiableListIterator
All Implemented Interfaces:
Iterator, ListIterator
Enclosing class:
Collections

private static final class Collections.UnmodifiableListIterator
extends Collections.UnmodifiableIterator
implements ListIterator

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:
add in interface ListIterator

hasPrevious

public boolean hasPrevious()
Tests whether there are still elements to be retrieved from the underlying collection by previous(). When this method returns true, an exception will not be thrown on calling previous().

Specified by:
hasPrevious in interface ListIterator

nextIndex

public int nextIndex()
Find the index of the element that would be returned by a call to next. If hasNext() returns false, this returns the list size.

Specified by:
nextIndex in interface ListIterator

previous

public java.lang.Object previous()
Obtains the previous element in the underlying list.

Specified by:
previous in interface ListIterator

previousIndex

public int previousIndex()
Find the index of the element that would be returned by a call to previous. If hasPrevious() returns false, this returns -1.

Specified by:
previousIndex in interface ListIterator

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:
set in interface ListIterator

next

public java.lang.Object next()
Obtains the next element in the underlying collection.

Specified by:
next in interface Iterator

hasNext

public boolean hasNext()
Tests whether there are still elements to be retrieved from the underlying collection by next(). When this method returns true, an exception will not be thrown on calling next().

Specified by:
hasNext in interface Iterator

remove

public void remove()
Blocks the removal of elements from the underlying collection by the iterator.

Specified by:
remove in interface Iterator