All Packages Class Hierarchy This Package Previous Next Index
Class guinea.util.EnumerationMapper
java.lang.Object
|
+----guinea.util.EnumerationMapper
- public class EnumerationMapper
- extends Object
- implements Enumeration
EnumerationMapper maps values in an enumeration to a new enumeration.
The principle is more easily explained with an example in Scheme:
(map (lambda (x) (* x x)) '(1 2 3 4))
==> (1 4 9 16)
- See Also:
- EnumerationFilter
Constructor Index
- ·
EnumerationMapper(Enumeration, Mapper)
- Construct a new mapped enumeration.
Method Index
- ·
hasMoreElements()
- Tests if this enumeration contains more elements.
- ·
nextElement()
- Returns the next element of this enumeration.
Constructors
·
EnumerationMapper
public EnumerationMapper(Enumeration enum,
Mapper mapping)
- Construct a new mapped enumeration. It takes an enumeration and
returns a new enumeration that contains the objects of the original
enumeration mapped to a new value specified by the mapping.
- Parameters:
- enum - an enumeration to map.
- mapping - the mapping does the mapping from value to a new value
Methods
·
hasMoreElements
public boolean hasMoreElements()
- Tests if this enumeration contains more elements.
- Returns:
-
true
if this enumeration contains more elements;
false
otherwise.
·
nextElement
public Object nextElement()
- Returns the next element of this enumeration. The corresponding
element of the source enumeration is mapped to a new value by the
mapping.
- Returns:
- the next element of this enumeration.
- Throws: NoSuchElementException
- if no more elements exist.
All Packages Class Hierarchy This Package Previous Next Index