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
package Torello.Java.Function;

/**
 * Function-Pointer
 * <SPAN CLASS=TJF>Input:</SPAN> {@code int, int, T}
 * <SPAN CLASS=TJF>Output:</SPAN> {@code void}.
 * 
 * <BR /><BR />
 * Utilized in {@link Torello.Java.JSON}
 * 
 * @param <T> The type of the third (last) input-parameter.
 */
@FunctionalInterface
public interface IntIntTConsumer<T>
{
    /**
     * Performs {@code 'this'} operation on the given arguments.
     * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH>
     *
     * @param i First integer argument.
     * @param j Second integer argument.
     * @param t Typed {@code object} parameter.
     */
    public void accept(int i, int j, T t);

    /**
     * <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_METHOD>
     * @param after <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_AFTER>
     * @return      <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_RETURN>
     * @throws NullPointerException if parameter {@code 'other'} is null.
     */
    default IntIntTConsumer<T> andThen(IntIntTConsumer<? super T> after)
    {
        if (after == null)
            throw new NullPointerException("null has been passed to parameter 'after'");

        return (int i, int j, T t) ->
        {
            this.accept(i, j, t); 
            after.accept(i, j, t);
        };
    }
}