org.melati.poem.util
Class MappedEnumeration<T,I>
java.lang.Object
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)
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MappedEnumeration
public MappedEnumeration(Enumeration<I> enumeration)
- Wrapper Constructor given Enumeration to wrap.
- Parameters:
enumeration
- Enumeration to wrap
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.