Package net.sf.saxon.z
Class IntPredicateLambda
java.lang.Object
net.sf.saxon.z.IntPredicateLambda
- All Implemented Interfaces:
IntPredicate,IntPredicateProxy
This class allows an integer predicate (a boolean function of an integer) to be written as a lambda
expression, in a way that works both in Java and C#. It is needed because interfaces and delegates
are interchangeable in Java (through the mechanism of "functional interfaces"), but the same is not
the case in C#.
-
Method Summary
Modifier and TypeMethodDescriptionstatic IntPredicateProxyof(IntPredicate lambda) Implement an integer predicate as a lambda expressionbooleantest(int value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.IntPredicate
and, negate, orMethods inherited from interface net.sf.saxon.z.IntPredicateProxy
union
-
Method Details
-
of
Implement an integer predicate as a lambda expression- Parameters:
lambda- an implementation of the functional interfaceIntPredicate, generally supplied as a lambda expression (for examplei -> i > 0for a predicate that matches all positive integers).- Returns:
- the integer predicate
-
test
public boolean test(int value) - Specified by:
testin interfaceIntPredicate- Specified by:
testin interfaceIntPredicateProxy
-