Java Collections.scanLeft Examples

Java Collections.scanLeft - 2 examples found. These are the top rated real world Java examples of java.util.Collections.scanLeft extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 @Override
 public <U> Array<U> scanLeft(U zero, BiFunction<? super U, ? super T, ? extends U> operation) {
   Objects.requireNonNull(operation, "operation is null");
   return Collections.scanLeft(
       this,
       zero,
       operation,
       new java.util.ArrayList<>(),
       (c, u) -> {
         c.add(u);
         return c;
       },
       list -> Array.wrap(list.toArray()));
 }
Example #2
0
 @Override
 default <U> Seq<U> scanLeft(U zero, BiFunction<? super U, ? super T, ? extends U> operation) {
   Objects.requireNonNull(operation, "operation is null");
   return Collections.scanLeft(this, zero, operation, List.empty(), List::prepend, List::reverse);
 }