public final class IntAccumulator extends java.lang.Object implements AccumulatorLike<java.lang.Object,IntAccumulator>
IntAccumulator
is a low-level collection specialized for gathering
elements in parallel and then joining them in order by merging them.
This is a manually specialized variant of Accumulator
with no actual
subclassing relationship with Accumulator
.Constructor and Description |
---|
IntAccumulator() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
adder()
A `BiConsumer` that adds an element to an `Accumulator`, suitable for use with `java.util.stream.IntStream`'s `collect` method.
|
int |
apply(int i)
Retrieves the `ix`th element, using an `Int` index.
|
int |
apply(long ix)
Retrieves the `ix`th element.
|
static java.lang.Object |
boxedAdder()
A `BiConsumer` that adds a boxed `Int` to an `IntAccumulator`, suitable for use with `java.util.stream.Stream`'s `collect` method.
|
void |
clear()
Remove all accumulated elements from this accumulator.
|
long |
cumulative(int i) |
int[] |
current() |
void |
drain(IntAccumulator that)
Removes all elements from `that` and appends them to this `IntAccumulator`.
|
static <A> IntAccumulator |
from(scala.collection.TraversableOnce<java.lang.Object> source)
Builds an `IntAccumulator` from any `Int`-valued `TraversableOnce`
|
static void |
hIndex_$eq(int x$1) |
static int |
hIndex() |
int[][] |
history() |
static void |
index_$eq(int x$1) |
static int |
index() |
scala.collection.Iterator<java.lang.Object> |
iterator()
Returns an `Iterator` over the contents of this `IntAccumulator`.
|
static java.lang.Object |
merger()
A `BiConsumer` that merges `IntAccumulator`s, suitable for use with `java.util.stream.IntStream`'s `collect` method.
|
static int |
nextBlockSize() |
java.util.stream.IntStream |
parStream()
Produces a parallel Java 8 `IntStream` over the elements of this `IntAccumulator`
|
static long |
seekSlot(long ix) |
java.util.stream.IntStream |
seqStream()
Produces a sequential Java 8 `IntStream` over the elements of this `IntAccumulator`
|
static long |
size() |
java.util.Spliterator.OfInt |
spliterator()
Returns a `java.util.Spliterator.OfInt` over the contents of this `IntAccumulator`
|
IntStepper |
stepper()
Returns an `IntStepper` over the contents of this `IntAccumulator`
|
static java.lang.Object |
supplier()
A `Supplier` of `IntAccumulator`s, suitable for use with `java.util.stream.IntStream`'s `collect` method.
|
<Coll> Coll |
to(scala.collection.generic.CanBuildFrom<scala.runtime.Nothing$,java.lang.Object,Coll> cbf)
Copies the elements in this
IntAccumulator to a specified collection. |
int[] |
toArray()
Copies the elements in this `IntAccumulator` into an `Array[Int]`
|
scala.collection.immutable.List<java.lang.Object> |
toList()
Copies the elements in this `IntAccumulator` 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 java.lang.Object supplier()
public static java.lang.Object adder()
public static java.lang.Object boxedAdder()
public static java.lang.Object merger()
public static <A> IntAccumulator from(scala.collection.TraversableOnce<java.lang.Object> 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 int[] current()
public int[][] history()
public long cumulative(int i)
cumulative
in interface AccumulatorLike<java.lang.Object,IntAccumulator>
public final void drain(IntAccumulator that)
public void clear()
AccumulatorLike
clear
in interface AccumulatorLike<java.lang.Object,IntAccumulator>
public final int apply(long ix)
public final int apply(int i)
public final IntStepper stepper()
public final scala.collection.Iterator<java.lang.Object> iterator()
public final java.util.Spliterator.OfInt spliterator()
public final java.util.stream.IntStream seqStream()
public final java.util.stream.IntStream parStream()
public final int[] toArray()
public final scala.collection.immutable.List<java.lang.Object> toList()
public final <Coll> Coll to(scala.collection.generic.CanBuildFrom<scala.runtime.Nothing$,java.lang.Object,Coll> cbf)
IntAccumulator
to a specified collection.
Note that the target collection is not specialized.
Usage example: acc.to[Vector]
cbf
- (undocumented)