org.webmacro.util
Class EnumIterator
java.lang.Object
|
+--org.webmacro.util.EnumIterator
- All Implemented Interfaces:
- java.util.Iterator
- public final class EnumIterator
- extends java.lang.Object
- implements java.util.Iterator
Allow a Java 1.1 enumeration to be used as a JDK 1.2 style Iterator
Constructor Summary |
EnumIterator(java.util.Enumeration e)
Construct an iterator given an enumeration |
Method Summary |
boolean |
hasNext()
Return true if we have not yet reached the end of the enumeration |
static void |
main(java.lang.String[] arg)
Test harness |
java.lang.Object |
next()
Advance the iterator and return the next value. |
void |
remove()
Unsupported |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnumIterator
public EnumIterator(java.util.Enumeration e)
- Construct an iterator given an enumeration
hasNext
public final boolean hasNext()
- Return true if we have not yet reached the end of the enumeration
- Specified by:
hasNext
in interface java.util.Iterator
next
public final java.lang.Object next()
throws java.util.NoSuchElementException
- Advance the iterator and return the next value. Return null if we
reach the end of the enumeration.
- Specified by:
next
in interface java.util.Iterator
remove
public final void remove()
throws java.lang.UnsupportedOperationException
- Unsupported
- Specified by:
remove
in interface java.util.Iterator
main
public static void main(java.lang.String[] arg)
- Test harness