net.cscott.jutil
public abstract class UnmodifiableListIterator<E> extends Object implements ListIterator<E>
UnmodifiableListIterator
is an abstract superclass to
save you the trouble of implementing the remove()
,
add()
and set()
methods over and over again
for those list iterators which don't implement them. The name's a
bit clunky, but fits with the JDK naming in
java.util.Collections
and such.
Version: $Id: UnmodifiableListIterator.java,v 1.1 2003/03/20 01:58:20 cananian Exp $
Method Summary | |
---|---|
void | add(E o) Always throws an UnsupportedOperationException . |
abstract boolean | hasNext() Returns true if the list iterator has more elements
in the forward direction. |
abstract boolean | hasPrevious() Returns true if the list iterator has more elements
in the reverse direction. |
abstract E | next() Returns the next element in the list. |
abstract int | nextIndex() Returns the index of the element that would be returned by a
subsequent call to next() . |
abstract E | previous() Returns the previous element in the list. |
int | previousIndex() Returns the index of the element that would be returned by a
subsequent call to previous() . |
void | remove() Always throws an UnsupportedOperationException . |
void | set(E o) Always throws an UnsupportedOperationException . |
UnsupportedOperationException
.Throws: UnsupportedOperationException always.
true
if the list iterator has more elements
in the forward direction.true
if the list iterator has more elements
in the reverse direction.previous()
to go back and forth.
(Note that alternating calls to next()
and
previous()
will return the same element
repeatedly.)Throws: java.util.NoSuchElementException if the iteration has no next element.
next()
. (Returns list size if the
list iterator is at the end of the list.)next()
to go back and forth.
(Note that alternating calls to next()
and
previous()
will return the same element repeatedly.)Throws: java.util.NoSuchElementException if the iteration has no previous element.
previous()
. (Returns -1 if the
list iterator is at the beginning of the list.)UnsupportedOperationException
.Throws: UnsupportedOperationException always.
UnsupportedOperationException
.Throws: UnsupportedOperationException always.