public class TLcdMorphedEnumeration extends Object implements ILcdAutoCloseableEnumeration
Enumeration
from a given Enumeration
, by
applying a given transformation to each of the elements before returning it.
Example applications:
Constructor and Description |
---|
TLcdMorphedEnumeration(Enumeration aEnumeration,
ILcdMorphingFunction aMorphingFunction)
Constructs a new
Enumeration from the given Enumeration with a given
transformation. |
Modifier and Type | Method and Description |
---|---|
void |
close()
This close method does not throw checked exceptions.
|
boolean |
hasMoreElements()
Implements
Enumeration.hasMoreElements() . |
Object |
nextElement()
Implements
Enumeration.nextElement() . |
public TLcdMorphedEnumeration(Enumeration aEnumeration, ILcdMorphingFunction aMorphingFunction)
Enumeration
from the given Enumeration
with a given
transformation. For each originally enumerated element, the result of the
transformation is returned instead of the element itself.aEnumeration
- the basic Enumeration
that will be returned.aMorphingFunction
- the function that is applied to each of the elements.public boolean hasMoreElements()
Enumeration.hasMoreElements()
.hasMoreElements
in interface Enumeration
public Object nextElement()
Enumeration.nextElement()
.nextElement
in interface Enumeration
public void close()
ILcdAutoCloseableEnumeration
close
in interface ILcdAutoCloseableEnumeration
close
in interface AutoCloseable