1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64 | package Torello.Java.Function;
import java.util.function.Function;
/**
* Function-Pointer
* <SPAN CLASS=TJF>Input:</SPAN> {@code int, int, long}
* <SPAN CLASS=TJF>Output:</SPAN> {@code boolean}.
*
* <BR /><BR />
* <EMBED CLASS='external-html' DATA-FILE-ID=THREE_PRIMITIVE_PRED>
* <EMBED CLASS="globalDefs" DATA-Type1=int DATA-Type2=int DATA-Type3=long>
*/
@FunctionalInterface
public interface IntIntLongPred
{
/**
* Evaluates this predicate on the given arguments.
* <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH>
*
* @param i1 The first integer argument to the predicate.
* @param i2 The second integer argument to the predicate.
* @param l The {@code long} argument to the predicate.
*/
public boolean test(int i1, int i2, long l);
/**
* <EMBED CLASS='external-html' DATA-FILE-ID=PRED_AND_METHOD>
* @param other A predicate that will be logically-AND'ed with this predicate
* @return <EMBED CLASS='external-html' DATA-FILE-ID=PRED_AND_RETURN>
* @throws NullPointerException if parameter {@code 'other'} is null.
*/
public default IntIntLongPred and(IntIntLongPred other)
{
if (other == null) throw new NullPointerException
("null has been passed to parameter 'other'");
return (int i1, int i2, long l) ->
this.test(i1, i2, l) && other.test(i1, i2, l);
}
/**
* <EMBED CLASS='external-html' DATA-FILE-ID=PRED_NEGATE_METHOD>
* @return <EMBED CLASS='external-html' DATA-FILE-ID=PRED_NEGATE_RETURN>
*/
default IntIntLongPred negate()
{ return (int i1, int i2, long l) -> ! this.test(i1, i2, l); }
/**
* <EMBED CLASS='external-html' DATA-FILE-ID=PRED_OR_METHOD>
* @param other a predicate that will be logically-ORed with this predicate
* @return <EMBED CLASS='external-html' DATA-FILE-ID=PRED_OR_RETURN>
* @throws NullPointerException if parameter {@code 'other'} is null.
*/
default IntIntLongPred or(IntIntLongPred other)
{
if (other == null)
throw new NullPointerException("null has been passed to parameter 'other'");
return (int i1, int i2, long l) ->
this.test(i1, i2, l) || other.test(i1, i2, l);
}
}
|