public class StepperExtensions<A>
extends java.lang.Object
| Constructor and Description |
|---|
StepperExtensions(scala.collection.Stepper<A> s) |
| Modifier and Type | Method and Description |
|---|---|
<C> C |
accumulate(scala.collection.convert.StreamExtensions.AccumulatorFactoryInfo<A,C> info) |
long |
count()
Consumes all remaining elements in this
Stepper and counts how many there are. |
long |
count(scala.Function1<A,java.lang.Object> p)
Consumes all remaining elements in this
Stepper and counts how many satisfy condition p. |
boolean |
exists(scala.Function1<A,java.lang.Object> p)
Searches for an element that satisfies condition
p. |
scala.Option<A> |
find(scala.Function1<A,java.lang.Object> p)
Searches for an element that satisifes condition
p, returning it wrapped in Some if one is found, or None otherwise. |
<B> B |
fold(B zero,
scala.Function2<B,A,B> op)
Repeatedly applies
op to propagate an initial value zero through all elements of the collection. |
<B> B |
foldTo(B zero,
scala.Function2<B,A,B> op,
scala.Function1<B,java.lang.Object> p)
Repeatedly applies
op to propagate an initial value zero through the collection until a condition p is met. |
void |
foreach(scala.Function1<A,scala.runtime.BoxedUnit> f)
Applies
f to every remaining element in the collection. |
A |
reduce(scala.Function2<A,A,A> op)
Repeatedly merges elements with
op until only a single element remains. |
protected scala.collection.Stepper<A> |
s() |
scala.collection.Stepper<A> |
substep() |
public StepperExtensions(scala.collection.Stepper<A> s)
public <C> C accumulate(scala.collection.convert.StreamExtensions.AccumulatorFactoryInfo<A,C> info)
public long count()
Stepper and counts how many there are.
This is a terminal operation.public long count(scala.Function1<A,java.lang.Object> p)
Stepper and counts how many satisfy condition p.
This is a terminal operation.p - (undocumented)public boolean exists(scala.Function1<A,java.lang.Object> p)
p. If none are found, it returns false.
This is a terminal operation.p - (undocumented)public scala.Option<A> find(scala.Function1<A,java.lang.Object> p)
p, returning it wrapped in Some if one is found, or None otherwise.
This is a terminal operation.p - (undocumented)public <B> B fold(B zero,
scala.Function2<B,A,B> op)
op to propagate an initial value zero through all elements of the collection.
Traversal order is left-to-right.
This is a terminal operation.zero - (undocumented)op - (undocumented)public <B> B foldTo(B zero,
scala.Function2<B,A,B> op,
scala.Function1<B,java.lang.Object> p)
op to propagate an initial value zero through the collection until a condition p is met.
If p is never met, the result of the last operation is returned.
This is a terminal operation.zero - (undocumented)op - (undocumented)p - (undocumented)public void foreach(scala.Function1<A,scala.runtime.BoxedUnit> f)
f to every remaining element in the collection.
This is a terminal operation.f - (undocumented)public A reduce(scala.Function2<A,A,A> op)
op until only a single element remains.
Throws an exception if the Stepper is empty.
Merging occurs from left to right.
This is a terminal operation.op - (undocumented)protected scala.collection.Stepper<A> s()
public scala.collection.Stepper<A> substep()