Language

Spliterators.AbstractSpliterator.TryAdvance(IConsumer) Method

Definition

If a remaining element exists: performs the given action on it, returning true; else returns false.

public abstract bool TryAdvance(Java.Util.Functions.IConsumer? action);
abstract member TryAdvance : Java.Util.Functions.IConsumer -> bool

Parameters

action
IConsumer

The action whose operation is performed at-most once

Returns

false if no remaining elements existed upon entry to this method, else true.

Implements

Remarks

If a remaining element exists, the action is performed on it and the method returns true; otherwise, the method returns false. If this spliterator has the Ordered characteristic, the action is performed on the next element in encounter order. Exceptions thrown by the action are relayed to the caller. Subsequent behavior of the spliterator is unspecified if the action throws an exception.

Java reference for java.util.Spliterator.tryAdvance.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to