public class NullIterator<E>
extends java.lang.Object
implements java.util.Enumeration<E>, java.util.Iterator<E>
| Constructor and Description |
|---|
NullIterator()
Default Constructor.
|
NullIterator(E element)
Explicit Value Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear this Iterator (so that it no longer has
an element).
|
boolean |
hasMoreElements()
Returns true if this Enumeration has another element
(required by Enumeration).
|
boolean |
hasNext()
Returns true if this Iterator has another element
(required by Iterator).
|
E |
next()
Returns the next element in this Iterator
(required by Iterator).
|
E |
nextElement()
Returns the next element in this Enumeration
(required by Enumeration).
|
void |
remove()
Remove the last element from the underlying collection
(required by Iterator).
|
void |
reset()
Reset this Iterator so that it (again) contains
the single element.
|
void |
setElement(E element)
Set the single element in this Iterator.
|
public NullIterator()
public NullIterator(E element)
element - The element in the Iteratorpublic void clear()
public boolean hasMoreElements()
hasMoreElements in interface java.util.Enumeration<E>public boolean hasNext()
hasNext in interface java.util.Iterator<E>public E nextElement() throws java.util.NoSuchElementException
nextElement in interface java.util.Enumeration<E>java.util.NoSuchElementExceptionpublic E next() throws java.util.NoSuchElementException
next in interface java.util.Iterator<E>java.util.NoSuchElementExceptionpublic void remove()
throws java.lang.UnsupportedOperationException
remove in interface java.util.Iterator<E>java.lang.UnsupportedOperationExceptionpublic void reset()
public void setElement(E element)
element - The element