|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.darwinsys.util.EnumerationIterator<T>
public class EnumerationIterator<T>
A GOF Adapter to make instances of old Enumeration interface behave like new Iterator interface, so we only have to deal with one well-defined implementation of the Iterator pattern.
Constructor Summary | |
---|---|
EnumerationIterator(java.util.Enumeration<T> old)
Construct an EnumerationIterator from an old-style Enumeration. |
Method Summary | |
---|---|
boolean |
hasNext()
Fulfills the general contract of Iterator.hasNext(), that is, return true as long as there is at least one more item in the Iterator. |
T |
next()
Fulfuls the general contract of Iterator.next(), that is, returns the next element in the Iterator. |
void |
remove()
Remove is not implemented (optional method). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EnumerationIterator(java.util.Enumeration<T> old)
old
- The Enumeration to be adapted.Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator
public T next()
next
in interface java.util.Iterator
public void remove()
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- in all cases.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |