utilities
Class SafeEnumeration

java.lang.Object
  |
  +--utilities.SafeEnumeration
All Implemented Interfaces:
java.util.Enumeration

public class SafeEnumeration
extends java.lang.Object
implements java.util.Enumeration

Grabs all the elements in an enumeration and stores them locally before enumerating over them. This allows you to safely modify the original structure you are enumerating while you are enumerating.


Constructor Summary
SafeEnumeration(java.util.Enumeration e)
           
 
Method Summary
 boolean hasMoreElements()
           
 java.lang.Object nextElement()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SafeEnumeration

public SafeEnumeration(java.util.Enumeration e)
Method Detail

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface java.util.Enumeration

nextElement

public java.lang.Object nextElement()
Specified by:
nextElement in interface java.util.Enumeration