public static class StreamExtensions.DoubleStreamHasToScala
extends java.lang.Object
Constructor and Description |
---|
DoubleStreamHasToScala(java.util.stream.DoubleStream stream) |
Modifier and Type | Method and Description |
---|---|
scala.jdk.DoubleAccumulator |
accumulate() |
<CC> CC |
toScala(scala.collection.Factory<java.lang.Object,CC> factory)
Copy the elements of this stream into a Scala collection.
|
<C> C |
toScalaFactory(scala.collection.Factory<java.lang.Object,C> factory,
scala.collection.convert.StreamExtensions.AccumulatorFactoryInfo<java.lang.Object,C> info)
Copy the elements of this stream into a Scala collection.
|
public DoubleStreamHasToScala(java.util.stream.DoubleStream stream)
public scala.jdk.DoubleAccumulator accumulate()
public <CC> CC toScala(scala.collection.Factory<java.lang.Object,CC> factory)
For parallel streams, using accumulate
is recommended as it builds the DoubleAccumulator
in parallel.
When converting a parallel stream to a different Scala collection, the stream is first
converted into an Accumulator
, which supports parallel building. The accumulator is
then converted to the target collection. Note that the stream is processed eagerly while
building the accumulator, even if the target collection is lazy.
Sequential streams are directly converted to the target collection. If the target collection is lazy, the conversion is lazy as well.
factory
- (undocumented)public <C> C toScalaFactory(scala.collection.Factory<java.lang.Object,C> factory, scala.collection.convert.StreamExtensions.AccumulatorFactoryInfo<java.lang.Object,C> info)
Converting a parallel streams to an Accumulator
using stream.toScalaFactory(Accumulator)
builds the result in parallel.
A toScalaFactory(Accumulator)
call automatically converts the DoubleStream
to a primitive
DoubleAccumulator
.
When converting a parallel stream to a different Scala collection, the stream is first
converted into an Accumulator
, which supports parallel building. The accumulator is
then converted to the target collection. Note that the stream is processed eagerly while
building the accumulator, even if the target collection is lazy.
Sequential streams are directly converted to the target collection. If the target collection is lazy, the conversion is lazy as well.
factory
- (undocumented)info
- (undocumented)