001package Torello.Java.Function; 002 003/** 004 * Function-Pointer 005 * <SPAN CLASS=TJF>Input:</SPAN> {@code A, B, C} 006 * <SPAN CLASS=TJF>Output:</SPAN> {@code void}. 007 * 008 * <BR /><BR /> 009 * <EMBED CLASS='external-html' DATA-FILE-ID=BIG_CONSUMER> 010 * <EMBED CLASS="globalDefs" DATA-Name='Tri Consumer' DATA-Number=three> 011 * 012 * @param <A> The type of the first input-parameter. 013 * @param <B> The type of the second input-parameter. 014 * @param <C> The type of the last input-parameter. 015 */ 016@FunctionalInterface 017public interface TriConsumer<A, B, C> 018{ 019 /** 020 * Performs {@code 'this'} operation on the given arguments. 021 * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH> 022 * 023 * @param a the first input argument 024 * @param b the second input argument 025 * @param c the third input argument 026 */ 027 public void accept(A a, B b, C c); 028 029 /** 030 * <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_METHOD> 031 * @param after <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_AFTER> 032 * @return <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_RETURN> 033 * @throws NullPointerException if parameter {@code 'other'} is null. 034 */ 035 default TriConsumer<A, B, C> andThen(TriConsumer<? super A, ? super B, ? super C> after) 036 { 037 if (after == null) 038 throw new NullPointerException("null has been passed to parameter 'after'"); 039 040 return (A a, B b, C c) -> 041 { 042 this.accept(a, b, c); 043 after.accept(a, b, c); 044 }; 045 } 046 047}