Class Sequence<T>

  • All Implemented Interfaces:
    Generator<T>

    public final class Sequence<T>
    extends java.lang.Object
    implements Generator<T>
    A sequence Generator. It generates a sequence by passing the previous result (or initial value) into a given Function.
    • Constructor Summary

      Constructors 
      Constructor Description
      Sequence​(T first, Function<? super T,​? extends T> function)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T next()
      Generates and returns another value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Sequence

        public Sequence​(T first,
                        Function<? super T,​? extends T> function)
    • Method Detail

      • next

        public T next()
        Description copied from interface: Generator
        Generates and returns another value.
        Specified by:
        next in interface Generator<T>