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