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 IntPredicateProxy
of
(IntPredicate lambda) Implement an integer predicate as a lambda expressionboolean
test
(int value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.IntPredicate
and, negate, or
Methods 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 > 0
for a predicate that matches all positive integers).- Returns:
- the integer predicate
-
test
public boolean test(int value) - Specified by:
test
in interfaceIntPredicate
- Specified by:
test
in interfaceIntPredicateProxy
-