@Override public Spliterator.OfDouble execute() { try (final DoubleStream stream = buildPrevious()) { return stream.spliterator(); } } }
default Spliterator.OfDouble spliterator(DoublePipeline pipeline) { requireNonNull(pipeline); return optimize(pipeline).getAsDoubleStream().spliterator(); }
/** * Appends all values from {@code stream}, in order, to the end of the values the built {@link * ImmutableDoubleArray} will contain. */ public Builder addAll(DoubleStream stream) { Spliterator.OfDouble spliterator = stream.spliterator(); long size = spliterator.getExactSizeIfKnown(); if (size > 0) { // known *and* nonempty ensureRoomFor(Ints.saturatedCast(size)); } spliterator.forEachRemaining((DoubleConsumer) this::add); return this; }
/** * Appends all values from {@code stream}, in order, to the end of the values the built {@link * ImmutableDoubleArray} will contain. */ public Builder addAll(DoubleStream stream) { Spliterator.OfDouble spliterator = stream.spliterator(); long size = spliterator.getExactSizeIfKnown(); if (size > 0) { // known *and* nonempty ensureRoomFor(Ints.saturatedCast(size)); } spliterator.forEachRemaining((DoubleConsumer) this::add); return this; }
@Override public Spliterator.OfDouble spliterator() { if (isAllowStreamIteratorAndSpliterator()) { return stream().spliterator(); } throw newUnsupportedException("spliterator"); }
checkNotNull(function); boolean isParallel = stream.isParallel(); Spliterator.OfDouble fromSpliterator = stream.spliterator();
/** * Appends all values from {@code stream}, in order, to the end of the values the built {@link * ImmutableDoubleArray} will contain. */ public Builder addAll(DoubleStream stream) { Spliterator.OfDouble spliterator = stream.spliterator(); long size = spliterator.getExactSizeIfKnown(); if (size > 0) { // known *and* nonempty ensureRoomFor(Ints.saturatedCast(size)); } spliterator.forEachRemaining((DoubleConsumer) this::add); return this; }
checkNotNull(function); boolean isParallel = stream.isParallel(); Spliterator.OfDouble fromSpliterator = stream.spliterator();
checkNotNull(function); boolean isParallel = stream.isParallel(); Spliterator.OfDouble fromSpliterator = stream.spliterator();
checkNotNull(function); boolean isParallel = stream.isParallel(); Spliterator.OfDouble fromSpliterator = stream.spliterator();
/** * Peform intermediate operations on a primitive IntStream (gives improved performance when working with Integers) * If this ReactiveSeq has an OfInt Spliterator it will be converted directly to an IntStream, * otherwise the provided conversion function will be used. * * <pre> * {@code * ReactiveSeq.range(1, 1000) * .doubles(i->i.doubleValue(),s->s.map(i->i*2).filter(i->i<500)) .size(), //249 * * </pre> * * * @param fn * @param mapper * @return */ default ReactiveSeq<Double> doubles(ToDoubleFunction<? super T> fn,Function<? super DoubleStream, ? extends DoubleStream> mapper){ return ReactiveSeq.fromSpliterator(mapper.apply(mapToDouble(fn)).spliterator()); }
@Deprecated //moved to cyclops.companion.Functions public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> concatDoubles( ReactiveSeq<Double> b){ return a->fromSpliterator(DoubleStream.concat(a.mapToDouble(i->i),b.mapToDouble(i->i)).spliterator()); }
public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> concatDoubles( ReactiveSeq<Double> b){ return a->ReactiveSeq.fromSpliterator(DoubleStream.concat(a.mapToDouble(i->i),b.mapToDouble(i->i)).spliterator()); }
@Override public java.util.Spliterator.OfDouble spliterator() { // This is a terminal operation return evalAndclose(() -> stream.spliterator()); }
@Override public For forCompDouble(AnyVal<Double> any, Supplier<DoubleStream> stream) { streamFor.forComp(any, () -> StreamSupport.stream(stream.get().spliterator(), false)); return this; }
@Override public Spliterator.OfDouble spliterator() { if (isAllowStreamIteratorAndSpliterator()) { return stream().spliterator(); } throw newUnsupportedException("spliterator"); }
/** * Appends all values from {@code stream}, in order, to the end of the values the built {@link * ImmutableDoubleArray} will contain. */ public Builder addAll(DoubleStream stream) { Spliterator.OfDouble spliterator = stream.spliterator(); long size = spliterator.getExactSizeIfKnown(); if (size > 0) { // known *and* nonempty ensureRoomFor(Ints.saturatedCast(size)); } spliterator.forEachRemaining((DoubleConsumer) this::add); return this; }
/** * Appends all values from {@code stream}, in order, to the end of the values the built {@link * ImmutableDoubleArray} will contain. */ public Builder addAll(DoubleStream stream) { Spliterator.OfDouble spliterator = stream.spliterator(); long size = spliterator.getExactSizeIfKnown(); if (size > 0) { // known *and* nonempty ensureRoomFor(Ints.saturatedCast(size)); } spliterator.forEachRemaining((DoubleConsumer) this::add); return this; }
/** * Appends all values from {@code stream}, in order, to the end of the values the built {@link * ImmutableDoubleArray} will contain. */ public Builder addAll(DoubleStream stream) { Spliterator.OfDouble spliterator = stream.spliterator(); long size = spliterator.getExactSizeIfKnown(); if (size > 0) { // known *and* nonempty ensureRoomFor(Ints.saturatedCast(size)); } spliterator.forEachRemaining((DoubleConsumer) this::add); return this; }
/** * Appends all values from {@code stream}, in order, to the end of the values the built {@link * ImmutableDoubleArray} will contain. */ public Builder addAll(DoubleStream stream) { Spliterator.OfDouble spliterator = stream.spliterator(); long size = spliterator.getExactSizeIfKnown(); if (size > 0) { // known *and* nonempty ensureRoomFor(Ints.saturatedCast(size)); } spliterator.forEachRemaining((DoubleConsumer) this::add); return this; }