|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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(java.lang.Object object)
Constructs a new SingletonIterator . |
Method Summary | |
boolean |
hasNext()
Is another object available from the iterator. |
java.lang.Object |
next()
Get the next object from the iterator. |
void |
remove()
Remove always throws UnsupportedOperationException . |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SingletonIterator(java.lang.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 java.util.Iterator
public java.lang.Object next()
This returns the single object if it hasn't been returned yet.
next
in interface java.util.Iterator
java.util.NoSuchElementException
- if the single object has already
been returnedpublic void remove()
UnsupportedOperationException
.
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- always
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |