Package net.sf.saxon.z
Class IntPredicateLambda
- java.lang.Object
-
- net.sf.saxon.z.IntPredicateLambda
-
- All Implemented Interfaces:
java.util.function.IntPredicate
,IntPredicateProxy
public class IntPredicateLambda extends java.lang.Object implements 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IntPredicateProxy
of(java.util.function.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 net.sf.saxon.z.IntPredicateProxy
union
-
-
-
-
Method Detail
-
of
public static IntPredicateProxy of(java.util.function.IntPredicate lambda)
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 interfacejava.util.function.IntPredicate
- Specified by:
test
in interfaceIntPredicateProxy
-
-