IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
DelegatePredicate.cs
Go to the documentation of this file.
1using System;
2
3namespace java.util.function
4{
5
10 public class DelegatePredicate<TArg> : Predicate
11 {
12
13 readonly Func<TArg, bool> _func;
14
19 public DelegatePredicate(Func<TArg, bool> func)
20 {
21 _func = func ?? throw new ArgumentNullException(nameof(func));
22 }
23
24 public Predicate and(Predicate other)
25 {
26 return Predicate.__DefaultMethods.and(this, other);
27 }
28
29 public Predicate negate()
30 {
31 return Predicate.__DefaultMethods.negate(this);
32 }
33
34 public Predicate or(Predicate other)
35 {
36 return Predicate.__DefaultMethods.or(this, other);
37 }
38
39 public bool test(object t)
40 {
41 return _func((TArg)t);
42 }
43
44 }
45
46}
Implements the Predicate interface against a delegate.
DelegatePredicate(Func< TArg, bool > func)
Initializes a new instance.