List of usage examples for java.util.function DoubleConsumer DoubleConsumer
DoubleConsumer
From source file:com.simiacryptus.mindseye.lang.Tensor.java
/** * Get doubles double [ ].//from ww w . j av a2 s. co m * * @param stream the stream * @param dim the length * @return the double [ ] */ public static double[] getDoubles(@Nonnull final DoubleStream stream, final int dim) { final double[] doubles = RecycleBin.DOUBLES.obtain(dim); stream.forEach(new DoubleConsumer() { int j = 0; @Override public void accept(final double value) { doubles[j++] = value; } }); return doubles; }