Modifier | Constructor and Description |
---|---|
private |
EmptyIterator()
Constructor declaration
|
Modifier and Type | Method and Description |
---|---|
static Iterator |
getInstance()
Returns the singleton EmptyIterator object.
|
boolean |
hasNext()
Checks whether the iterator can scan further.
|
Object |
next()
Retrieves the next element in the collection scanned by this
iterator.
|
void |
remove()
Remove the element pointed to by this iterator from the
collection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
private static final Iterator it
public static Iterator getInstance()
public boolean hasNext()
public Object next()
next
in interface Iterator
NoSuchElementException
- Always, because the underlying
collection is always empty.public void remove()
remove
in interface Iterator
RuntimeException
- Always, because the underlying
collection is always empty.