- All Superinterfaces:
- java.io.Serializable
public interface Foldable<X,Y>
extends java.io.Serializable
Represents a folding operation applicable to streams or collection
Initial value of type Y is the value that is returned on an empty collection.
Apply is used on a pair of values to produce the next value.
Apply takes a value of argument type X and a value of result type Y.
Having this, you can define reduction on a collection or a stream.
This is the core of map/reduce.
- See Also:
- wikipedia for details.