|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.iterators.ListIteratorWrapper<E>
public class ListIteratorWrapper<E>
As the wrapped Iterator is traversed, ListIteratorWrapper builds a LinkedList of its values, permitting all required operations of ListIterator.
Constructor Summary | |
---|---|
ListIteratorWrapper(Iterator<E> iterator)
Constructs a new ListIteratorWrapper that will wrap
the given iterator. |
Method Summary | |
---|---|
void |
add(E o)
Throws UnsupportedOperationException . |
boolean |
hasNext()
Returns true if there are more elements in the iterator. |
boolean |
hasPrevious()
Returns true if there are previous elements in the iterator. |
E |
next()
Returns the next element from the iterator. |
int |
nextIndex()
Returns in the index of the next element. |
E |
previous()
Returns the the previous element. |
int |
previousIndex()
Returns the index of the previous element. |
void |
remove()
Throws UnsupportedOperationException . |
void |
set(E o)
Throws UnsupportedOperationException . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListIteratorWrapper(Iterator<E> iterator)
ListIteratorWrapper
that will wrap
the given iterator.
iterator
- the iterator to wrap
NullPointerException
- if the iterator is nullMethod Detail |
---|
public void add(E o) throws UnsupportedOperationException
UnsupportedOperationException
.
add
in interface ListIterator<E>
o
- ignored
UnsupportedOperationException
- alwayspublic boolean hasNext()
hasNext
in interface Iterator<E>
hasNext
in interface ListIterator<E>
public boolean hasPrevious()
hasPrevious
in interface ListIterator<E>
public E next() throws NoSuchElementException
next
in interface Iterator<E>
next
in interface ListIterator<E>
NoSuchElementException
- if there are no more elementspublic int nextIndex()
nextIndex
in interface ListIterator<E>
public E previous() throws NoSuchElementException
previous
in interface ListIterator<E>
NoSuchElementException
- if there are no previous elementspublic int previousIndex()
previousIndex
in interface ListIterator<E>
public void remove() throws UnsupportedOperationException
UnsupportedOperationException
.
remove
in interface Iterator<E>
remove
in interface ListIterator<E>
UnsupportedOperationException
- alwayspublic void set(E o) throws UnsupportedOperationException
UnsupportedOperationException
.
set
in interface ListIterator<E>
o
- ignored
UnsupportedOperationException
- always
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |