org.pf.util
Class CollectionEnumeration<E>

java.lang.Object
  extended by org.pf.util.CollectionEnumeration<E>
All Implemented Interfaces:
java.util.Enumeration<E>

public class CollectionEnumeration<E>
extends java.lang.Object
implements java.util.Enumeration<E>

An enumeration object that can be used to iterate over all elements of an underlying collection.

Version:
1.0
Author:
Manfred Duchrow

Constructor Summary
CollectionEnumeration(java.util.Collection<E> coll)
          Initialize the new instance with a collection.
CollectionEnumeration(java.util.Iterator<E> iter)
          Initialize the new instance with an iterator.
 
Method Summary
 boolean hasMoreElements()
           
 E nextElement()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionEnumeration

public CollectionEnumeration(java.util.Iterator<E> iter)
Initialize the new instance with an iterator.

Parameters:
iter - An iteration (must not be null)

CollectionEnumeration

public CollectionEnumeration(java.util.Collection<E> coll)
Initialize the new instance with a collection.

Parameters:
coll - A collection (must not be null)
Method Detail

hasMoreElements

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

nextElement

public E nextElement()
Specified by:
nextElement in interface java.util.Enumeration<E>