net.sf.zig_project.gpl.common.enumerations
Class JoinedEnumeration

java.lang.Object
  extended bynet.sf.zig_project.gpl.common.enumerations.JoinedEnumeration
All Implemented Interfaces:
Enumeration

public class JoinedEnumeration
extends Object
implements Enumeration

Joins an Enumeration of Enumerations. This class will enumerate over a series of independant enumerations, allowing several collections of elements to behave as a joined collection.

Version:
April 20, 2005
Author:
Frank Ziglar

Field Summary
protected  Enumeration active_enum
          The current enumeration in sequence being enumerated
protected  Enumeration series
          The sequence of Enumerations this instance will join
 
Constructor Summary
JoinedEnumeration(Enumeration e)
          Creates the enumerable joint.
 
Method Summary
 boolean hasMoreElements()
          Determines if at least one element is still available in at least one enumeration.
 Object nextElement()
          Retrieves the next element within this enumeration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

series

protected final Enumeration series
The sequence of Enumerations this instance will join


active_enum

protected Enumeration active_enum
The current enumeration in sequence being enumerated

Constructor Detail

JoinedEnumeration

public JoinedEnumeration(Enumeration e)
Creates the enumerable joint.

Parameters:
e - the sequence of Enumerations to be joined
Method Detail

hasMoreElements

public boolean hasMoreElements()
Determines if at least one element is still available in at least one enumeration.

Specified by:
hasMoreElements in interface Enumeration
Returns:
true there are still remaining elements to be enumerated, false otherwise

nextElement

public Object nextElement()
Retrieves the next element within this enumeration.

Specified by:
nextElement in interface Enumeration
Returns:
the next element in this enumeration
Throws:
NoSuchElementException - if there are no remaining elements