Package Torello.Java.Function
Interface HexConsumer<A,B,C,D,E,F>
-
- Type Parameters:
A
- The type of the first input-parameter.B
- The type of the second input-parameter.C
- The type of the third input-parameter.D
- The type of the fourth input-parameter.E
- The type of the fifth input-parameter.F
- The type of the last input-parameter.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface HexConsumer<A,B,C,D,E,F>
Function-Pointer Input:A, B, C, D, E, F
Output:void
.
This is an extension of Java's original functional-interfaces package. TheFunctional Interface
designed here creates a "Hex Consumer" - a straight-forward extension ofinterface java.util.function.Consumer
- but instead has an'accept(...)'
method receiving six variable-type parameters instead of just one.
NOTE: Java's Basic Packagejava.util.function.*
, contains aninterface
namedBiConsumer
, that extends the basicConsumer<T>
tointerface BiConsumer<T, U>
. Theinterface
that is implemented here follows a similar vein, but extends the number of generic type-parameters to six, instead of two.
Hi-Lited Source-Code:- View Here: Torello/Java/Function/HexConsumer.java
- Open New Browser-Tab: Torello/Java/Function/HexConsumer.java
File Size: 1,935 Bytes Line Count: 55 '\n' Characters Found
-
-
Method Summary
@FunctionalInterface: (Lambda) Method Modifier and Type Method void
accept(A a, B b, C c, D d, E e, F f)
Default Composition & Builder Method(s) Modifier and Type Method default HexConsumer<A,
B,
C,
D,
E,
F>andThen(HexConsumer<? super A,? super B,? super C,? super D,? super E,? super F> after)
-
-
-
Method Detail
-
accept
void accept(A a, B b, C c, D d, E e, F f)
Performs'this'
operation on the given arguments.
FunctionalInterface Target-Method:
This method corresponds to the@FunctionalInterface
Annotation's method requirement. It is the only non-default
, non-static
method in this interface, and may be the target of a Lambda-Expression or'::'
(double-colon) Function-Pointer.- Parameters:
a
- the first input argumentb
- the second input argumentc
- the third input argumentd
- the fourth input argumente
- the fifth input argumentf
- the sixth input argument
-
andThen
default HexConsumer<A,B,C,D,E,F> andThen (HexConsumer<? super A,? super B,? super C,? super D,? super E,? super F> after)
Returns a composed consumer that performs, in sequence,'this'
operation followed by the after operation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, the'after'
operation will not be performed.- Parameters:
after
- The operation to perform after this operation- Returns:
- A composed consumer that performs in sequence
'this'
operation followed by the'after'
operation. - Throws:
java.lang.NullPointerException
- if parameter'other'
is null.- Code:
- Exact Method Body:
if (after == null) throw new NullPointerException("null has been passed to parameter 'after'"); return (A a, B b, C c, D d, E e, F f) -> { this.accept(a, b, c, d, e, f); after.accept(a, b, c, d, e, f); };
-
-