Class RepeatItemIterator<T>

  • Type Parameters:
    T - the type of items in the iterator.
    All Implemented Interfaces:
    Iterator<T>

    public class RepeatItemIterator<T>
    extends Object
    implements Iterator<T>
    An RepeatItemIterator is an Iterator which contains multiple copies of the same object.
    • Constructor Detail

      • RepeatItemIterator

        public RepeatItemIterator​(T item,
                                  long repeats)
    • Method Detail

      • hasNext

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

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