java.lang.Object | +--org.apache.commons.collections.iterators.SingletonListIteratorAll Implemented Interfaces:
SingletonListIterator(Object object) Constructs a new SingletonListIterator. |
void | add(Object obj) Add always throws UnsupportedOperationException. |
boolean | hasNext() Is another object available from the iterator? This returns true if the single object hasn't been returned yet. |
boolean | Is a previous object available from the iterator? This returns true if the single object has been returned. |
Object | next() Get the next object from the iterator. |
int | Returns the index of the element that would be returned by a subsequent call to next. |
Object | previous() Get the previous object from the iterator. |
int | Returns the index of the element that would be returned by a subsequent call to previous. |
void | remove() Remove the object from this iterator. |
void | reset() Reset the iterator back to the start. |
void | set(Object obj) Set sets the value of the singleton. |
public SingletonListIterator(Object object)
SingletonListIterator
.
public void add(Object obj)
- alwayspublic boolean hasNext()
public boolean hasPrevious()
public Object next()
- if the single object has already
been returnedpublic int nextIndex()
public Object previous()
- if the single object has not already
been returnedpublic int previousIndex()
public void remove()
- if the next or previous
method has not yet been called, or the remove method
has already been called after the last call to next
or previous.public void reset()
public void set(Object obj)
- if next has not been called
or the object has been removed
SingletonIterator
is an ListIterator over a single object instance.