public static < Accumulator , Value > Accumulator reduce ( List < Value > list , Accumulator init , ReduceClosure < Accumulator , Value > f ) { Accumulator accumulator = init ; for ( Value value : list ) { accumulator = f . eval ( accumulator , value ) ; } return accumulator ; }
Applies a binary function between each element of the given list .