public final class Accumulator<A> extends java.lang.Object implements AccumulatorLike<A,Accumulator<A>>
Accumulator
is a low-level collection specialized for gathering
elements in parallel and then joining them in order by merging Accumulators.
Accumulators can contain more than Int.MaxValue
elements.Constructor and Description |
---|
Accumulator() |
Modifier and Type | Method and Description |
---|---|
static <A> java.lang.Object |
adder()
A `BiConsumer` that adds an element to an `Accumulator`, suitable for use with `java.util.stream.Stream`'s `collect` method.
|
A |
apply(int i)
Retrieves the `ix`th element, using an `Int` index.
|
A |
apply(long ix)
Retrieves the `ix`th element.
|
void |
clear()
Remove all accumulated elements from this accumulator.
|
long[] |
cumul() |
long |
cumulative(int i) |
java.lang.Object[] |
current() |
<A1 extends A> |
drain(Accumulator<A1> that)
Removes all elements from `that` and appends them to this `Accumulator`.
|
static <A> Accumulator<A> |
from(scala.collection.TraversableOnce<A> source)
Builds an `Accumulator` from any `TraversableOnce`
|
static void |
hIndex_$eq(int x$1) |
static int |
hIndex() |
java.lang.Object[][] |
history() |
static void |
index_$eq(int x$1) |
static int |
index() |
scala.collection.Iterator<A> |
iterator()
Returns an `Iterator` over the contents of this `Accumulator`.
|
static <A> java.lang.Object |
merger()
A `BiConsumer` that merges `Accumulator`s, suitable for use with `java.util.stream.Stream`'s `collect` method.
|
static int |
nextBlockSize() |
java.util.stream.Stream<A> |
parStream()
Produces a parallel Java 8 Stream over the elements of this `Accumulator`
|
static long |
seekSlot(long ix) |
java.util.stream.Stream<A> |
seqStream()
Produces a sequential Java 8 Stream over the elements of this `Accumulator`
|
static long |
size() |
java.util.Spliterator<A> |
spliterator()
Returns a `java.util.Spliterator` over the contents of this `Accumulator`
|
AnyStepper<A> |
stepper()
Returns a `Stepper` over the contents of this `Accumulator`
|
static <A> java.lang.Object |
supplier()
A `Supplier` of `Accumulator`s, suitable for use with `java.util.stream.Stream`'s `collect` method.
|
<Coll> Coll |
to(scala.collection.generic.CanBuildFrom<scala.runtime.Nothing$,A,Coll> cbf)
Copies the elements in this
Accumulator to a specified collection. |
java.lang.Object |
toArray(scala.reflect.ClassTag<A> tag)
Copies the elements in this `Accumulator` into an `Array`
|
scala.collection.immutable.List<A> |
toList()
Copies the elements in this `Accumulator` to a `List`
|
static void |
totalSize_$eq(long x$1) |
static long |
totalSize() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hIndex, index, nextBlockSize, seekSlot, size, totalSize
public static <A> java.lang.Object supplier()
public static <A> java.lang.Object adder()
public static <A> java.lang.Object merger()
public static <A> Accumulator<A> from(scala.collection.TraversableOnce<A> source)
public static int index()
public static void index_$eq(int x$1)
public static int hIndex()
public static void hIndex_$eq(int x$1)
public static long totalSize()
public static void totalSize_$eq(long x$1)
public static int nextBlockSize()
public static final long size()
public static long seekSlot(long ix)
public java.lang.Object[] current()
public java.lang.Object[][] history()
public long[] cumul()
public long cumulative(int i)
cumulative
in interface AccumulatorLike<A,Accumulator<A>>
public final <A1 extends A> void drain(Accumulator<A1> that)
public void clear()
AccumulatorLike
clear
in interface AccumulatorLike<A,Accumulator<A>>
public final A apply(long ix)
public final A apply(int i)
public final AnyStepper<A> stepper()
public final scala.collection.Iterator<A> iterator()
public final java.util.Spliterator<A> spliterator()
public final java.util.stream.Stream<A> seqStream()
public final java.util.stream.Stream<A> parStream()
public final java.lang.Object toArray(scala.reflect.ClassTag<A> tag)
public final scala.collection.immutable.List<A> toList()
public final <Coll> Coll to(scala.collection.generic.CanBuildFrom<scala.runtime.Nothing$,A,Coll> cbf)
Accumulator
to a specified collection.
Usage example: acc.to[Vector]
cbf
- (undocumented)