@Override public IntStreamEx filter(IntPredicate predicate) { return new IntStreamEx(stream().filter(predicate), context); }
@Override public StreamEx<Integer> boxed() { return new StreamEx<>(stream().boxed(), context); }
/** * {@inheritDoc} * * @see #collect(IntCollector) */ @Override public <R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R, R> combiner) { if (context.fjp != null) return context.terminate(() -> stream().collect(supplier, accumulator, combiner)); return stream().collect(supplier, accumulator, combiner); }
@Override final IntStreamEx callWhile(IntStreamEx stream, IntPredicate predicate, boolean drop) { try { return new IntStreamEx((IntStream) JDK9_METHODS[IDX_INT_STREAM][drop ? IDX_DROP_WHILE : IDX_TAKE_WHILE] .invokeExact(stream.stream(), predicate), stream.context); } catch (Error | RuntimeException e) { throw e; } catch (Throwable e) { throw new InternalError(e); } }
@Override public IntStreamEx distinct() { return new IntStreamEx(stream().distinct(), context); }
@Override public IntStreamEx limit(long maxSize) { return new IntStreamEx(stream().limit(maxSize), context); }
@Override public LongStreamEx asLongStream() { return new LongStreamEx(stream().asLongStream(), context); }
@Override public DoubleStreamEx mapToDouble(IntToDoubleFunction mapper) { return new DoubleStreamEx(stream().mapToDouble(mapper), context); }
@Override public IntStreamEx sorted() { return new IntStreamEx(stream().sorted(), context); }
@Override public IntStreamEx skip(long n) { return new IntStreamEx(stream().skip(n), context); }
@Override public IntStreamEx flatMap(IntFunction<? extends IntStream> mapper) { return new IntStreamEx(stream().flatMap(mapper), context); }