Class IteratorDecorator<E>
java.lang.Object
com.globalmentor.collections.iterators.AbstractIteratorDecorator<E>
com.globalmentor.collections.iterators.IteratorDecorator<E>
- Type Parameters:
E
- the type of elements returned by this iterator.
- All Implemented Interfaces:
Enumeration<E>
,Iterator<E>
- Direct Known Subclasses:
AbstractConverterCollection.ConverterIterator
,AbstractConverterList.ConverterIterator
,CountedFilterIterator
,ListIteratorDecorator
An iterator that wraps an existing iterator.
- Author:
- Garret Wilson
- API Note:
- This iterator also serves as an adapter, converting an iterator to an
Enumeration
. - Implementation Note:
- Subclasses may override
AbstractIteratorDecorator.hasNext()
and/orAbstractIteratorDecorator.next()
, andEnumeration
compatibility will be maintained.
-
Constructor Summary
-
Method Summary
Methods inherited from class com.globalmentor.collections.iterators.AbstractIteratorDecorator
hasMoreElements, hasNext, next, nextElement, remove
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
IteratorDecorator
Iterator constructor.- Parameters:
iterator
- The iterator this iterator will decorate.- Throws:
NullPointerException
- if the given iterator isnull
.
-
-
Method Details
-
getIterator
- Specified by:
getIterator
in classAbstractIteratorDecorator<E>
- Returns:
- The iterator this class decorates.
-