Class SingleElementIterator<E>

java.lang.Object
io.github.mmm.base.collection.SingleElementIterator<E>
Type Parameters:
E - type of the element to iterate.
All Implemented Interfaces:
Enumeration<E>, Iterator<E>

public class SingleElementIterator<E> extends Object implements Enumeration<E>, Iterator<E>
Implementation of both Iterator and Enumeration that iterates only a single element.
Since:
1.0.0
  • Constructor Details

    • SingleElementIterator

      public SingleElementIterator(E element)
      The constructor.
      Parameters:
      element - the single element to iterate. If null the iterator will be empty.
  • Method Details