|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcollectionframework.NullIterator<E>
public class NullIterator<E>
An Iterator/Enumeration that contains one (or zero) elements
Constructor Summary | |
---|---|
NullIterator()
Default Constructor |
|
NullIterator(E element)
Explicit Value Constructor |
Method Summary | |
---|---|
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) This method is not supported |
void |
reset()
Reset this Iterator so that it (again) contains the single element |
void |
setElement(E element)
Set the single element in this Iterator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NullIterator()
public NullIterator(E element)
element
- The element in the IteratorMethod Detail |
---|
public 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.NoSuchElementException
public E next() throws java.util.NoSuchElementException
next
in interface java.util.Iterator<E>
java.util.NoSuchElementException
public void remove() throws java.lang.UnsupportedOperationException
remove
in interface java.util.Iterator<E>
java.lang.UnsupportedOperationException
public void reset()
public void setElement(E element)
element
- The element
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |