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

public class IteratorDecorator<E> extends AbstractIteratorDecorator<E>
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/or AbstractIteratorDecorator.next(), and Enumeration compatibility will be maintained.
  • Constructor Details

    • IteratorDecorator

      public IteratorDecorator(@Nonnull Iterator<E> iterator)
      Iterator constructor.
      Parameters:
      iterator - The iterator this iterator will decorate.
      Throws:
      NullPointerException - if the given iterator is null.
  • Method Details