|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.collections.iterators.SingletonIterator
SingletonIterator
is an Iterator
over a single
object instance.
Constructor Summary | |
SingletonIterator(Object object)
Constructs a new SingletonIterator . |
Method Summary | |
boolean |
hasNext()
Is another object available from the iterator? |
Object |
next()
Get the next object from the iterator. |
void |
remove()
Remove the object from this iterator. |
void |
reset()
Reset the iterator to the start. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SingletonIterator(Object object)
SingletonIterator
.object
- the single object to return from the iteratorMethod Detail |
public boolean hasNext()
This returns true if the single object hasn't been returned yet.
hasNext
in interface Iterator
public Object next()
This returns the single object if it hasn't been returned yet.
next
in interface Iterator
NoSuchElementException
- if the single object has already
been returnedpublic void remove()
remove
in interface Iterator
IllegalStateException
- if the next method has not
yet been called, or the remove method has already
been called after the last call to the next
method.public void reset()
reset
in interface ResettableIterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |