File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
main/scala/scala/compat/java8
test/scala/scala/compat/java8 Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -292,6 +292,24 @@ with converterImpl.Priority1AccumulatorConverters
292292 def parStream : LongStream = seqStream.parallel
293293 }
294294
295+ implicit final class EnrichDoubleWrappedArrayWithStream (private val a : collection.mutable.WrappedArray [Double ])
296+ extends AnyVal with MakesSequentialStream [java.lang.Double , DoubleStream ] with MakesParallelStream [java.lang.Double , DoubleStream ] {
297+ def seqStream : DoubleStream = java.util.Arrays .stream(a.array)
298+ def parStream : DoubleStream = seqStream.parallel
299+ }
300+
301+ implicit final class EnrichIntWrappedArrayWithStream (private val a : collection.mutable.WrappedArray [Int ])
302+ extends AnyVal with MakesSequentialStream [java.lang.Integer , IntStream ] with MakesParallelStream [java.lang.Integer , IntStream ] {
303+ def seqStream : IntStream = java.util.Arrays .stream(a.array)
304+ def parStream : IntStream = seqStream.parallel
305+ }
306+
307+ implicit final class EnrichLongWrappedArrayWithStream (private val a : collection.mutable.WrappedArray [Long ])
308+ extends AnyVal with MakesSequentialStream [java.lang.Long , LongStream ] with MakesParallelStream [java.lang.Long , LongStream ] {
309+ def seqStream : LongStream = java.util.Arrays .stream(a.array)
310+ def parStream : LongStream = seqStream.parallel
311+ }
312+
295313 implicit val primitiveAccumulateDoubleStream = new PrimitiveStreamAccumulator [Stream [Double ], DoubleAccumulator ] {
296314 def streamAccumulate (stream : Stream [Double ]): DoubleAccumulator =
297315 stream.collect(DoubleAccumulator .supplier, DoubleAccumulator .boxedAdder, DoubleAccumulator .merger)
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ class StreamConvertersTest {
255255 def streamMaterialization (): Unit = {
256256 val coll = collection.mutable.WrappedArray .make[Int ](Array (1 ,2 ,3 ))
257257 val streamize = implicitly[collection.mutable.WrappedArray [Int ] => MakesSequentialStream [java.lang.Integer , IntStream ]]
258- assertTrue(streamize(coll).getClass.getName.contains(" EnrichScalaCollectionWithSeqIntStream " ))
258+ assertTrue(streamize(coll).getClass.getName.contains(" EnrichIntWrappedArrayWithStream " ))
259259 val steppize = implicitly[collection.mutable.WrappedArray [Int ] => MakesStepper [IntStepper ]]
260260 assertTrue(steppize(coll).getClass.getName.contains(" RichArrayIntCanStep" ))
261261 }
You can’t perform that action at this time.
0 commit comments