|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackboard.base.NullIterator
public class NullIterator
A "null" implementation of the Iterator
interface. Basically, this
is an iterator that never actually iterates. Instead it simulates iterating
over an empty list by always returning false
from hasNext()
.
Method Summary | |
---|---|
static NullIterator |
getInstance()
Returns a NullIterator instance. |
boolean |
hasNext()
Since there is nothing to iterate over, there is never a "next" item, and this method always returns false . |
java.lang.Object |
next()
Since there is nothing to iterate over, this method always returns
null . |
void |
remove()
This method does nothing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static NullIterator getInstance()
NullIterator
instance. Since there isn't much point
in having lot of instances of a "null" object (an object that does nothing)
floating around, this method always returns the same instance.
NullIterator
.public boolean hasNext()
false
.
hasNext
in interface java.util.Iterator
false
.public java.lang.Object next()
null
.
next
in interface java.util.Iterator
null
.public void remove()
remove
in interface java.util.Iterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |