Saxon.Api
Class Predicate<T>
-
public class Predicate<T>
- implements IPredicate<T>
This class implements the IPredicate
interface which represents a predicate (boolean-valued Func
) of one argument.
Constructor Summary |
|
---|---|
Predicate (Func<T, bool> f)
Predicate constructor method to wrap the |
Property Summary |
|
---|---|
Func Unwrapped Func property which evaluates to boolean. |
Method Summary |
|
---|---|
<T1> IPredicate<T1> | And(IPredicate<T1> other)
Returns a composed predicate that represents a short-circuiting logical
AND of this predicate and another. When evaluating the composed
predicate, if this predicate is |
<T1> bool | Invoke(T1 item) Evaluates this predicate on the given argument. |
IPredicate<T> | Negate() Returns a predicate that represents the logical negation of this predicate. |
<T1> IPredicate<T1> | Or(IPredicate<T1> other)
Returns a composed predicate that represents a short-circuiting logical
OR of this predicate and another. When evaluating the composed
predicate, if this predicate is |
Method Detail
And
Invoke
Evaluates this predicate on the given argument.
Parameters:
item
- The input itemReturns:
true
if the input argument matches the predicate, otherwise false
.Negate
Returns a predicate that represents the logical negation of this predicate.
Returns:
Or
Returns a composed predicate that represents a short-circuiting logical
OR of this predicate and another. When evaluating the composed
predicate, if this predicate is true
, then the other
predicate is not evaluated.
Parameters:
other
- A predicate that will be logically-ORed with this predicateReturns:
other
predicate.
Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another. When evaluating the composed predicate, if this predicate is
false
, then theother
predicate is not evaluated.Parameters:
other
- A predicate that will be logically-ANDed with this predicateReturns:
other
predicate.