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