@Override final Node.Builder<Double> makeNodeBuilder(long exactSizeIfKnown, IntFunction<Double[]> generator) { return Nodes.doubleBuilder(exactSizeIfKnown); }
@Override final Node.Builder<Double> makeNodeBuilder(long exactSizeIfKnown, IntFunction<Double[]> generator) { return Nodes.doubleBuilder(exactSizeIfKnown); }
/** * Produces a {@link Node.Builder.OfDouble}. * * @param exactSizeIfKnown -1 if a variable size builder is requested, * otherwise the exact capacity desired. A fixed capacity builder will * fail if the wrong number of elements are added to the builder. * @return a {@code Node.Builder.OfDouble} */ static Node.Builder.OfDouble doubleBuilder(long exactSizeIfKnown) { return (exactSizeIfKnown >= 0 && exactSizeIfKnown < MAX_ARRAY_SIZE) ? new DoubleFixedNodeBuilder(exactSizeIfKnown) : doubleBuilder(); }
/** * Produces a {@link Node.Builder.OfDouble}. * * @param exactSizeIfKnown -1 if a variable size builder is requested, * otherwise the exact capacity desired. A fixed capacity builder will * fail if the wrong number of elements are added to the builder. * @return a {@code Node.Builder.OfDouble} */ static Node.Builder.OfDouble doubleBuilder(long exactSizeIfKnown) { return (exactSizeIfKnown >= 0 && exactSizeIfKnown < MAX_ARRAY_SIZE) ? new DoubleFixedNodeBuilder(exactSizeIfKnown) : doubleBuilder(); }
static Node.OfDouble truncate(Node.OfDouble this_, long from, long to, IntFunction<Double[]> generator) { if (from == 0 && to == this_.count()) return this_; long size = to - from; Spliterator.OfDouble spliterator = this_.spliterator(); Node.Builder.OfDouble nodeBuilder = Nodes.doubleBuilder(size); nodeBuilder.begin(size); for (int i = 0; i < from && spliterator.tryAdvance((DoubleConsumer) e -> { }); i++) { } if (to == this_.count()) { spliterator.forEachRemaining((DoubleConsumer) nodeBuilder); } else { for (int i = 0; i < size && spliterator.tryAdvance((DoubleConsumer) nodeBuilder); i++) { } } nodeBuilder.end(); return nodeBuilder.build(); }
static Node.OfDouble truncate(Node.OfDouble this_, long from, long to, IntFunction<Double[]> generator) { if (from == 0 && to == this_.count()) return this_; long size = to - from; Spliterator.OfDouble spliterator = this_.spliterator(); Node.Builder.OfDouble nodeBuilder = Nodes.doubleBuilder(size); nodeBuilder.begin(size); for (int i = 0; i < from && spliterator.tryAdvance((DoubleConsumer) e -> { }); i++) { } if (to == this_.count()) { spliterator.forEachRemaining((DoubleConsumer) nodeBuilder); } else { for (int i = 0; i < size && spliterator.tryAdvance((DoubleConsumer) nodeBuilder); i++) { } } nodeBuilder.end(); return nodeBuilder.build(); }