Class ProducerIterator<T>

  • Type Parameters:
    T - The type of the products and the iterator elements
    All Implemented Interfaces:
    Iterator<T>
    Direct Known Subclasses:
    DirectoryIterator

    public class ProducerIterator<T>
    extends Object
    implements Iterator<T>
    An Iterator that iterates over all the objects produced by a delegate Producer.
    See Also:
    Producer
    • Constructor Detail

      • ProducerIterator

        public ProducerIterator​(Producer<T> producer)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface Iterator<T>
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<T>