|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.rwth.utils.SingletonIterator
Implements an Iterator
with a single, non-null
entry.
Iterator
Field Summary | |
protected java.lang.Object |
o
Contains the entry, or null if this element has already been
retrieved. |
Constructor Summary | |
SingletonIterator(java.lang.Object o)
Creates a new SingletonIterator instance. |
Method Summary | |
boolean |
hasNext()
Implements the hasNext method from the Iterator
interface. |
java.lang.Object |
next()
Implements the next method from the Iterator
interface. |
void |
remove()
Implements the next method from the Iterator interface
by always throwing an UnsupportedOperationException . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Object o
null
if this element has already been
retrieved.Constructor Detail |
public SingletonIterator(java.lang.Object o)
SingletonIterator
instance.o
- an Object
value. If this is null
, then
the Iterator
is empty.Method Detail |
public boolean hasNext()
hasNext
method from the Iterator
interface.hasNext
in interface java.util.Iterator
boolean
valuepublic java.lang.Object next()
next
method from the Iterator
interface.next
in interface java.util.Iterator
Object
valuepublic void remove()
next
method from the Iterator
interface
by always throwing an UnsupportedOperationException
.remove
in interface java.util.Iterator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |