tryAdvance() 尝试遍历,对元素执行动作。
/** * If a remaining element exists, performs the given action on it, * returning {@code true}; else returns {@code false}. If this * Spliterator is {@link #ORDERED} the action is performed on the * next element in encounter order. Exceptions thrown by the * action are relayed to the caller. * * @param action The action * @return {@code false} if no remaining elements existed * upon entry to this method, else {@code true}. * @throws NullPointerException if the specified action is null */ boolean tryAdvance(Consumer<? super T> action);JAVA8学习——Stream底层的实现(学习过程) (4)
内容版权声明:除非注明,否则皆为本站原创文章。