org.melati.poem.util
Class MappedEnumeration

java.lang.Object
  extended by org.melati.poem.util.MappedEnumeration
All Implemented Interfaces:
java.util.Enumeration

public abstract class MappedEnumeration
extends java.lang.Object
implements java.util.Enumeration

An Enumeration that encapsulates another and translates each element according to an abstract mapping function.

Implementations must provide mapped(Object).


Constructor Summary
MappedEnumeration(java.util.Enumeration enumeration)
          Wrapper Constructor given Enumeration to wrap.
 
Method Summary
 boolean hasMoreElements()
          
protected abstract  java.lang.Object mapped(java.lang.Object element)
           
 java.lang.Object nextElement()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappedEnumeration

public MappedEnumeration(java.util.Enumeration enumeration)
Wrapper Constructor given Enumeration to wrap.

Parameters:
enumeration - Enumeration to wrap
Method Detail

hasMoreElements

public boolean hasMoreElements()

Specified by:
hasMoreElements in interface java.util.Enumeration
See Also:
Enumeration.hasMoreElements()

mapped

protected abstract java.lang.Object mapped(java.lang.Object element)
Parameters:
element - the element of the Enumeration to act on
Returns:
the element after transformation

nextElement

public java.lang.Object nextElement()

Specified by:
nextElement in interface java.util.Enumeration
See Also:
Enumeration.nextElement()


Copyright © 2000-2009 PanEris. All Rights Reserved.