Class AnyMatch

All Implemented Interfaces:
JepComponent, PostfixMathCommandI, Serializable

public class AnyMatch extends BinaryFunction implements JepComponent
Tests a predicate against sequence.
anyMatch(  x => x%2==0, [1,2,3]); // true
anyMatch(  x => x%2==0, [1,3,5]); // false
allMatch(  x => x%2==0, [2,4,6]); // true
allMatch(  x => x%2==0, [1,2,3]); // false
noneMatch( x => x%2==0, [1,3,5]); // true
noneMatch( x => x%2==0, [1,2,3]); // false
Using these function can be considerable faster than using
firstOr(map( x=> true, filter(x => x%2==0, [1,2,3])), false);
as it can stop processing the list as soon as a match is found.
Since:
Jep 4.1, extensions 2.2
See Also:
  • Constructor Details

  • Method Details