Class ThrottledIterator<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    Serializable, Iterator<T>

    public class ThrottledIterator<T>
    extends Object
    implements Iterator<T>, Serializable
    A variant of the collection source (emits a sequence of elements as a stream) that supports throttling the emission rate.
    See Also:
    Serialized Form
    • Constructor Detail

      • ThrottledIterator

        public ThrottledIterator​(Iterator<T> source,
                                 long elementsPerSecond)
    • 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>