Streams 发表于 2022-12-20 | 分类于 ---WebFlux | Stream 操作的是元素,可迭代,可遍历。可迭代放入 Collection 集合接口, 123456789101112131415161718192021222324252627282930313233343536373839404142434445public interface Collection<E> extends Iterable<E> { Iterator<E> iterator(); default Spliterator<E> spliterator() { return Spliterators.spliterator(this, 0); } default Stream<E> stream() { return StreamSupport.stream(spliterator(), false); } default Stream<E> parallelStream() { return StreamSupport.stream(spliterator(), true); }}public interface Spliterator<T> { long estimateSize(); boolean tryAdvance(Consumer<? super T> action); default void forEachRemaining(Consumer<? super T> action) { do { } while (tryAdvance(action)); }}public abstract class CountedCompleter<T> extends ForkJoinTask<T> { public abstract void compute(); protected final boolean exec() { compute(); return false; } public T getRawResult() { return null; }}public abstract class ForkJoinTask<V> implements Future<V>, Serializable { protected abstract boolean exec();}