Class Folded<X,​T>

  • Type Parameters:
    X - Type of input and output
    T - Type of element
    All Implemented Interfaces:
    Scalar<X>

    public final class Folded<X,​T>
    extends Object
    implements Scalar<X>
    Iterable, which elements are "folded" through the func.
    Since:
    0.30
    • Constructor Detail

      • Folded

        @SafeVarargs
        public Folded​(X ipt,
                      BiFunc<? super X,​? super T,​? extends X> fnc,
                      T... list)
        Ctor.
        Parameters:
        ipt - Input
        fnc - Func original
        list - Array of items
      • Folded

        public Folded​(X ipt,
                      BiFunc<? super X,​? super T,​? extends X> fnc,
                      Iterable<? extends T> list)
        Ctor.
        Parameters:
        ipt - Input
        fnc - Func original
        list - List of items
    • Method Detail

      • value

        public X value()
                throws Exception
        Description copied from interface: Scalar
        Convert it to the value.
        Specified by:
        value in interface Scalar<X>
        Returns:
        The value
        Throws:
        Exception - If fails