tryAdvance

open override fun tryAdvance(action: (T) -> Unit): Boolean

If a remaining element exists: performs the given action on it, returning true; else returns false. If this Spliterator is ORDERED, the action is performed on the next element in encounter order. Exceptions thrown by the action are relayed to the caller.

Return

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

Parameters

action

The action whose operation is performed at-most once.

Throws

if the specified action is null (implicit in Kotlin non-null type).