|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Util.UnmodifiableListIterator
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.
Constructor Summary | |
UnmodifiableListIterator()
|
Method Summary | |
void |
add(Object 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 Object |
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 Object |
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(Object o)
Always throws an UnsupportedOperationException . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UnmodifiableListIterator()
Method Detail |
public abstract boolean hasNext()
true
if the list iterator has more elements
in the forward direction.
hasNext
in interface ListIterator
public abstract Object next()
previous()
to go back and forth.
(Note that alternating calls to next()
and
previous()
will return the same element
repeatedly.)
next
in interface ListIterator
NoSuchElementException
- if the iteration has no next element.public abstract boolean hasPrevious()
true
if the list iterator has more elements
in the reverse direction.
hasPrevious
in interface ListIterator
public abstract Object previous()
next()
to go back and forth.
(Note that alternating calls to next()
and
previous()
will return the same element repeatedly.)
previous
in interface ListIterator
NoSuchElementException
- if the iteration has no previous
element.public abstract int nextIndex()
next()
. (Returns list size if the
list iterator is at the end of the list.)
nextIndex
in interface ListIterator
public int previousIndex()
previous()
. (Returns -1 if the
list iterator is at the beginning of the list.)
previousIndex
in interface ListIterator
public final void remove()
UnsupportedOperationException
.
remove
in interface ListIterator
UnsupportedOperationException
- always.public final void set(Object o)
UnsupportedOperationException
.
set
in interface ListIterator
UnsupportedOperationException
- always.public final void add(Object o)
UnsupportedOperationException
.
add
in interface ListIterator
UnsupportedOperationException
- always.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |