Package com.luciad.util.enumeration
Class TLcdMorphedEnumeration
java.lang.Object
com.luciad.util.enumeration.TLcdMorphedEnumeration
- All Implemented Interfaces:
ILcdAutoCloseableEnumeration,AutoCloseable,Enumeration
This class generates a modified
Enumeration from a given Enumeration, by
applying a given transformation to each of the elements before returning it.
Example applications:
- The transformation can return a property or field of each element,
- It can decode the element to a proper format and return that,
- It can return the element itself, and just execute a side effect.
-
Constructor Summary
ConstructorsConstructorDescriptionTLcdMorphedEnumeration(Enumeration aEnumeration, ILcdMorphingFunction aMorphingFunction) Constructs a newEnumerationfrom the givenEnumerationwith a given transformation. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()This close method does not throw checked exceptions.booleanImplementsEnumeration.hasMoreElements().ImplementsEnumeration.nextElement().Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Enumeration
asIterator
-
Constructor Details
-
TLcdMorphedEnumeration
Constructs a newEnumerationfrom the givenEnumerationwith a given transformation. For each originally enumerated element, the result of the transformation is returned instead of the element itself.- Parameters:
aEnumeration- the basicEnumerationthat will be returned.aMorphingFunction- the function that is applied to each of the elements.
-
-
Method Details
-
hasMoreElements
public boolean hasMoreElements()ImplementsEnumeration.hasMoreElements().- Specified by:
hasMoreElementsin interfaceEnumeration
-
nextElement
ImplementsEnumeration.nextElement().- Specified by:
nextElementin interfaceEnumeration
-
close
public void close()Description copied from interface:ILcdAutoCloseableEnumerationThis close method does not throw checked exceptions.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceILcdAutoCloseableEnumeration
-