001package Torello.Java.Function;
002
003/**
004 * Function-Pointer
005 * <SPAN CLASS=TJF>Input:</SPAN> {@code int, long}
006 * <SPAN CLASS=TJF>Output:</SPAN> {@code void}.
007 * 
008 * <BR /><BR />
009 * <EMBED CLASS='external-html' DATA-FILE-ID=TWO_PRIMITIVE_CONS>
010 * <EMBED CLASS="globalDefs" DATA-Type1=int DATA-Type2=long>
011 */
012@FunctionalInterface
013public interface IntLongConsumer
014{
015    /**
016     * Performs this operation on the given arguments.
017     * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH>
018     *
019     * @param i The integer (first) input-argument.
020     * @param l The long (second) input-argument.
021     */
022    public void accept(int i, long l);
023
024    /**
025     * <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_METHOD>
026     * @param after <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_AFTER>
027     * @return <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_RETURN>
028     * @throws NullPointerException if parameter {@code 'other'} is null.
029     */
030    default IntLongConsumer andThen(IntLongConsumer after)
031    {
032        if (after == null)
033            throw new NullPointerException("null has been passed to parameter 'after'");
034
035        return (int i, long l) ->
036        {
037            this.accept(i, l); 
038            after.accept(i, l);
039        };
040    }
041
042}