Class EnumerationDecorator<E>
- java.lang.Object
-
- com.globalmentor.collections.iterators.AbstractEnumerationDecorator<E>
-
- com.globalmentor.collections.iterators.EnumerationDecorator<E>
-
- Type Parameters:
E
- the type of elements returned by this enumeration.
- All Implemented Interfaces:
java.util.Enumeration<E>
,java.util.Iterator<E>
public class EnumerationDecorator<E> extends AbstractEnumerationDecorator<E>
An enumeration that wraps an existing enumeration.- Author:
- Garret Wilson
- API Note:
- This enumeration also serves as an adapter, converting an enumeration to an
Iterator
. - Implementation Specification:
- This implementation does not support element removal.
- Implementation Note:
- Subclasses may override
AbstractEnumerationDecorator.hasMoreElements()
and/orAbstractEnumerationDecorator.nextElement()
, andIterator
compatibility will be maintained.
-
-
Constructor Summary
Constructors Constructor Description EnumerationDecorator(java.util.Enumeration<E> enumeration)
Enumeration constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Enumeration<E>
getEnumeration()
-
Methods inherited from class com.globalmentor.collections.iterators.AbstractEnumerationDecorator
hasMoreElements, hasNext, next, nextElement, remove
-
-
-
-
Constructor Detail
-
EnumerationDecorator
public EnumerationDecorator(@Nonnull java.util.Enumeration<E> enumeration)
Enumeration constructor.- Parameters:
enumeration
- The enumeration this enumeration will decorate.- Throws:
java.lang.NullPointerException
- if the given enumeration isnull
.
-
-
Method Detail
-
getEnumeration
protected java.util.Enumeration<E> getEnumeration()
- Specified by:
getEnumeration
in classAbstractEnumerationDecorator<E>
- Returns:
- The enumeration this class decorates.
-
-