BoxSetNone
Test whether no element of a Set satisfies a predicate.
Iteration short-circuits on the first element for which the predicate returns true. Returns true for an empty Set. The predicate receives the element value, its 1-based ordinal position, and the Set itself.
Method Signature
BoxSetNone(set=[set], callback=[function:Predicate])Arguments
Argument
Type
Required
Description
Default
set
set
true
The set to test.
callback
function:Predicate
true
Predicate invoked for each element. Receives {@code (value, ordinal, set)}. Short-circuits on the first {@code true} result.
Examples
Test that no element satisfies a predicate
Returns true when the callback returns false for every element.
s = [ 1, 2, 3, 4 ].toSet();
writeOutput( s.none( ( Any v ) => v > 100 ) );
Result: true
Returns false as soon as one element matches
Result: false
Related
Last updated
Was this helpful?
