List of usage examples for java.util Spliterator SIZED
int SIZED
To view the source code for java.util Spliterator SIZED.
Click Source Link
From source file:com.wrmsr.kleist.util.Itertools.java
public static <T> Stream<T> lazyStream(Supplier<? extends T> supplier) { return StreamSupport.stream(Spliterators.spliterator(lazyIterator(supplier), 1, Spliterator.SIZED), false); }
From source file:org.apache.tinkerpop.gremlin.process.traversal.Traversal.java
/** * Return the traversal as a {@link Stream}. * * @return the traversal as a stream.// w ww. jav a 2 s. c o m */ public default Stream<E> toStream() { return StreamSupport.stream( Spliterators.spliteratorUnknownSize(this, Spliterator.IMMUTABLE | Spliterator.SIZED), false); }
From source file:org.briljantframework.array.AbstractBooleanArray.java
@Override public Stream<Boolean> stream() { return StreamSupport.stream(Spliterators.spliterator(new Iterator<Boolean>() { int current = 0; @Override/*ww w .j av a 2 s . c om*/ public boolean hasNext() { return current < size(); } @Override public Boolean next() { return get(current++); } }, size(), Spliterator.SIZED), false); }
From source file:org.briljantframework.array.AbstractComplexArray.java
@Override public Stream<Complex> stream() { return StreamSupport.stream(Spliterators.spliterator(new Iterator<Complex>() { int current = 0; @Override//from ww w. jav a2 s. c om public boolean hasNext() { return current < size(); } @Override public Complex next() { return get(current++); } }, size(), Spliterator.SIZED), false); }
From source file:org.briljantframework.array.AbstractDoubleArray.java
@Override public DoubleStream stream() { PrimitiveIterator.OfDouble ofDouble = new PrimitiveIterator.OfDouble() { public int current = 0; @Override/*from www . j a v a 2s. c o m*/ public double nextDouble() { return get(current++); } @Override public boolean hasNext() { return current < size(); } }; Spliterator.OfDouble spliterator = Spliterators.spliterator(ofDouble, size(), Spliterator.SIZED); return StreamSupport.doubleStream(spliterator, false); }
From source file:org.briljantframework.array.AbstractIntArray.java
@Override public IntStream stream() { PrimitiveIterator.OfInt ofInt = new PrimitiveIterator.OfInt() { private int current = 0; @Override//from ww w. ja v a 2 s .co m public int nextInt() { return get(current++); } @Override public boolean hasNext() { return current < size(); } }; Spliterator.OfInt spliterator = Spliterators.spliterator(ofInt, size(), Spliterator.SIZED); return StreamSupport.intStream(spliterator, false); }
From source file:org.briljantframework.array.AbstractLongArray.java
@Override public LongStream stream() { PrimitiveIterator.OfLong ofLong = new PrimitiveIterator.OfLong() { public int current = 0; @Override//from w w w . j ava 2 s . c o m public long nextLong() { return get(current++); } @Override public boolean hasNext() { return current < size(); } }; Spliterator.OfLong spliterator = Spliterators.spliterator(ofLong, size(), Spliterator.SIZED); return StreamSupport.longStream(spliterator, false); }