org.melati.poem.util
Class MappedEnumeration<T,I>

Package class diagram package MappedEnumeration
java.lang.Object
  extended by org.melati.poem.util.MappedEnumeration<T,I>
All Implemented Interfaces:
Enumeration<T>

public abstract class MappedEnumeration<T,I>
extends Object
implements Enumeration<T>

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

Implementations must provide mapped(Object).


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

Constructor Detail

MappedEnumeration

public MappedEnumeration(Enumeration<I> enumeration)
Wrapper Constructor given Enumeration to wrap.

Parameters:
enumeration - Enumeration to wrap
Method Detail

hasMoreElements

public boolean hasMoreElements()

Specified by:
hasMoreElements in interface Enumeration<T>
See Also:
Enumeration.hasMoreElements()

mapped

protected abstract T mapped(I element)
Parameters:
element - the element of the Enumeration to act on
Returns:
the element after transformation

nextElement

public T nextElement()

Specified by:
nextElement in interface Enumeration<T>
See Also:
Enumeration.nextElement()


Copyright © 2000-2010 PanEris. All Rights Reserved.