Home | History | Annotate | Download | only in util

Lines Matching refs:action

71      * Performs the given action for each remaining element, in the order
73 * or the action throws an exception. Errors or runtime exceptions
74 * thrown by the action are relayed to the caller.
76 * @param action The action to be performed for each element
77 * @throws NullPointerException if the specified action is null
80 void forEachRemaining(T_CONS action);
97 * Performs the given action for each remaining element until all elements
98 * have been processed or the action throws an exception. Actions are
100 * Exceptions thrown by the action are relayed to the caller.
106 * action.accept(nextInt());
109 * @param action The action to be performed for each element
110 * @throws NullPointerException if the specified action is null
112 default void forEachRemaining(IntConsumer action) {
113 Objects.requireNonNull(action);
115 action.accept(nextInt());
134 * If the action is an instance of {@code IntConsumer} then it is cast
136 * otherwise the action is adapted to an instance of
141 default void forEachRemaining(Consumer<? super Integer> action) {
142 if (action instanceof IntConsumer) {
143 forEachRemaining((IntConsumer) action);
146 // The method reference action::accept is never null
147 Objects.requireNonNull(action);
149 Tripwire.trip(getClass(), "{0} calling PrimitiveIterator.OfInt.forEachRemainingInt(action::accept)");
150 forEachRemaining((IntConsumer) action::accept);
171 * Performs the given action for each remaining element until all elements
172 * have been processed or the action throws an exception. Actions are
174 * Exceptions thrown by the action are relayed to the caller.
180 * action.accept(nextLong());
183 * @param action The action to be performed for each element
184 * @throws NullPointerException if the specified action is null
186 default void forEachRemaining(LongConsumer action) {
187 Objects.requireNonNull(action);
189 action.accept(nextLong());
208 * If the action is an instance of {@code LongConsumer} then it is cast
210 * otherwise the action is adapted to an instance of
215 default void forEachRemaining(Consumer<? super Long> action) {
216 if (action instanceof LongConsumer) {
217 forEachRemaining((LongConsumer) action);
220 // The method reference action::accept is never null
221 Objects.requireNonNull(action);
223 Tripwire.trip(getClass(), "{0} calling PrimitiveIterator.OfLong.forEachRemainingLong(action::accept)");
224 forEachRemaining((LongConsumer) action::accept);
244 * Performs the given action for each remaining element until all elements
245 * have been processed or the action throws an exception. Actions are
247 * Exceptions thrown by the action are relayed to the caller.
253 * action.accept(nextDouble());
256 * @param action The action to be performed for each element
257 * @throws NullPointerException if the specified action is null
259 default void forEachRemaining(DoubleConsumer action) {
260 Objects.requireNonNull(action);
262 action.accept(nextDouble());
281 * If the action is an instance of {@code DoubleConsumer} then it is
283 * {@link #forEachRemaining}; otherwise the action is adapted to
289 default void forEachRemaining(Consumer<? super Double> action) {
290 if (action instanceof DoubleConsumer) {
291 forEachRemaining((DoubleConsumer) action);
294 // The method reference action::accept is never null
295 Objects.requireNonNull(action);
297 Tripwire.trip(getClass(), "{0} calling PrimitiveIterator.OfDouble.forEachRemainingDouble(action::accept)");
298 forEachRemaining((DoubleConsumer) action::accept);