Class GeneratorNitems<T>

  • Type Parameters:
    T - Sequence element type.
    All Implemented Interfaces:
    Generator<T>, ru.ispras.testbase.knowledge.iterator.Iterator<java.util.List<T>>

    public final class GeneratorNitems<T>
    extends java.lang.Object
    implements Generator<T>
    GeneratorNitems generates N sequences with the help of another generator.

    If the nested generator produces less than N items, generation is repeated until N items are generated. If the nested generator is empty, no sequences are generated.

    • Constructor Detail

      • GeneratorNitems

        public GeneratorNitems​(Generator<T> generator,
                               int itemNumber)
    • Method Detail

      • init

        public void init()
        Specified by:
        init in interface ru.ispras.testbase.knowledge.iterator.Iterator<T>
      • hasValue

        public boolean hasValue()
        Specified by:
        hasValue in interface ru.ispras.testbase.knowledge.iterator.Iterator<T>
      • value

        public java.util.List<T> value()
        Specified by:
        value in interface ru.ispras.testbase.knowledge.iterator.Iterator<T>
      • next

        public void next()
        Specified by:
        next in interface ru.ispras.testbase.knowledge.iterator.Iterator<T>
      • stop

        public void stop()
        Specified by:
        stop in interface ru.ispras.testbase.knowledge.iterator.Iterator<T>
      • clone

        public GeneratorNitems<T> clone()
        Specified by:
        clone in interface ru.ispras.testbase.knowledge.iterator.Iterator<T>
        Overrides:
        clone in class java.lang.Object