edu.umd.cfar.lamp.viper.util
Class EnumIterator

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.util.EnumIterator
All Implemented Interfaces:
java.util.Iterator

public class EnumIterator
extends java.lang.Object
implements java.util.Iterator

An Iterator wrapper for a java Enumeration.

Since:
Jun 20, 2003
Author:
davidm@cfar.umd.edu

Constructor Summary
EnumIterator(java.util.Enumeration enum)
          Constructs a new Iterator wrapping the given enumeration.
 
Method Summary
 boolean hasNext()
          Tests to see if more elements remain.
 java.lang.Object next()
          Gets the next element of the enumeration.
 void remove()
          Enumerations do not support removal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumIterator

public EnumIterator(java.util.Enumeration enum)
Constructs a new Iterator wrapping the given enumeration.

Parameters:
enum - the enumeration to wrap
Method Detail

remove

public void remove()
Enumerations do not support removal.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException

hasNext

public boolean hasNext()
Tests to see if more elements remain.

Specified by:
hasNext in interface java.util.Iterator
Returns:
enum.hasMoreElements()

next

public java.lang.Object next()
Gets the next element of the enumeration.

Specified by:
next in interface java.util.Iterator
Returns:
enum.nextElement()