Package Torello.Java.Function
Classes extending Java's
A C-Styled Function Pointer is usually easy - it just contains a pointer - it is just a memory address of a C Function. Java, however, requires that the types of both the input-parameters, and the return-values be knownst and identified when using a Java Function Pointer. This differs from how the C-Compiler handles function-pointers. In C, the input and output types are irrelevant.
For whatever reason, Sun-Oracle did not provide a very comprehensive list for all of the combinations of
Regardless, any pre-defined Functional-Interface can be created by anybody who writes Java. Extending the original Java package with these Function-Pointer Type-Definiitions has been useful vis-a-vis the Java-HTML JAR Distribution (this JAR).
Functional Interface
- Java is a strongly-typed language.
It is different than other typed-languages like 'C++', because there aren't any memory addresses
allowed inside of a programmer's code in Java. As such, certain artifacts that a programmer
uses often can change as compared to other variants of typed programming-languages.
A C-Styled Function Pointer is usually easy - it just contains a pointer - it is just a memory address of a C Function. Java, however, requires that the types of both the input-parameters, and the return-values be knownst and identified when using a Java Function Pointer. This differs from how the C-Compiler handles function-pointers. In C, the input and output types are irrelevant.
For whatever reason, Sun-Oracle did not provide a very comprehensive list for all of the combinations of
Predicate, Consumer, Supplier
or Function
when it developed the
package java.util.function.*
Though more could have been done, recognizing that the
sheer number of combinations becomes so large (when including all of the variants of Java
Primitives), it is likely that Java's Function Pointer Package didn't "just forget" - it was a
conscious decision.
Regardless, any pre-defined Functional-Interface can be created by anybody who writes Java. Extending the original Java package with these Function-Pointer Type-Definiitions has been useful vis-a-vis the Java-HTML JAR Distribution (this JAR).
-
Single Primitive Java Entity Description BoolConsumer Function-Pointer Input:boolean
Output:void
ByteConsumer Function-Pointer Input:byte
Output:void
CharConsumer Function-Pointer Input:char
Output:void
FloatConsumer Function-Pointer Input:float
Output:void
ShortConsumer Function-Pointer Input:short
Output:void
BoolPredicate Function-Pointer Input:boolean
Output:boolean
BytePredicate Function-Pointer Input:boolean
Output:byte
CharPredicate Function-Pointer Input:char
Output:boolean
FloatPredicate Function-Pointer Input:float
Output:boolean
ShortPredicate Function-Pointer Input:short
Output:boolean
BoolSupplier Function-Pointer Input:NONE
Output:boolean
ByteSupplier Function-Pointer Input:NONE
Output:byte
CharSupplier Function-Pointer Input:NONE
Output:char
FloatSupplier Function-Pointer Input:NONE
Output:float
ShortSupplier Function-Pointer Input:NONE
Output:short
Multilple Object Types Java Entity Description TriConsumer<A,B,C> Function-Pointer Input:A, B, C
Output:void
TriFunction<A,B,C,R> Function-Pointer Input:A, B, C
Output:R
TriPredicate<A,B,C> Function-Pointer Input:A, B, C
Output:boolean
QuadConsumer<A,B,C,D> Function-Pointer Input:A, B, C, D
Output:void
QuadFunction<A,B,C,D,R> Function-Pointer Input:A, B, C, D
Output:R
QuadPredicate<A,B,C,D> Function-Pointer Input:A, B, C, D
Output:boolean
QuintConsumer<A,B,C,D,E> Function-Pointer Input:A, B, C, D, E
Output:void
QuintFunction<A,B,C,D,E,R> Function-Pointer Input:A, B, C, D, E
Output:R
QuintPredicate<A,B,C,D,E> Function-Pointer Input:A, B, C, D, E
Output:boolean
HexConsumer<A,B,C,D,E,F> Function-Pointer Input:A, B, C, D, E, F
Output:void
HexFunction<A,B,C,D,E,F,R> Function-Pointer Input:A, B, C, D, E, F
Output:R
HexPredicate<A,B,C,D,E,F> Function-Pointer Input:A, B, C, D, E, F
Output:boolean
Functions into a Primitive Java Entity Description ToDoubleTriFunction<A,B,C> Function-Pointer Input:A, B, C
Output:double
ToDoubleQuadFunction<A,B,C,D> Function-Pointer Input:A, B, C, D
Output:double
ToDoubleQuintFunction<A,B,C,D,E> Function-Pointer Input:A, B, C, D, E
Output:double
ToDoubleHexFunction<A,B,C,D,E,F> Function-Pointer Input:A, B, C, D, E, F
Output:double
ToIntTriFunction<A,B,C> Function-Pointer Input:A, B, C
Output:int
ToIntQuadFunction<A,B,C,D> Function-Pointer Input:A, B, C, D
Output:int
ToIntQuintFunction<A,B,C,D,E> Function-Pointer Input:A, B, C, D, E
Output:int
ToIntHexFunction<A,B,C,D,E,F> Function-Pointer Input:A, B, C, D, E, F
Output:int
ToLongTriFunction<A,B,C> Function-Pointer Input:A, B, C
Output:long
ToLongQuadFunction<A,B,C,D> Function-Pointer Input:A, B, C, D
Output:long
ToLongQuintFunction<A,B,C,D,E> Function-Pointer Input:A, B, C, D, E
Output:long
ToLongHexFunction<A,B,C,D,E,F> Function-Pointer Input:A, B, C, D, E, F
Output:long
ToByteFunction<A> Function-Pointer Input:A
Output:byte
ToByteBiFunction<A,B> Function-Pointer Input:A, B
Output:byte
ToByteTriFunction<A,B,C> Function-Pointer Input:A, B, C
Output:byte
ToByteQuadFunction<A,B,C,D> Function-Pointer Input:A, B, C, D
Output:byte
ToByteQuintFunction<A,B,C,D,E> Function-Pointer Input:A, B, C, D, E
Output:byte
ToByteHexFunction<A,B,C,D,E,F> Function-Pointer Input:A, B, C, D, E, F
Output:byte
ToCharFunction<A> Function-Pointer Input:A
Output:char
ToCharBiFunction<A,B> Function-Pointer Input:A, B
Output:char
ToCharTriFunction<A,B,C> Function-Pointer Input:A, B, C
Output:char
ToCharQuadFunction<A,B,C,D> Function-Pointer Input:A, B, C, D
Output:char
ToCharQuintFunction<A,B,C,D,E> Function-Pointer Input:A, B, C, D, E
Output:char
ToCharHexFunction<A,B,C,D,E,F> Function-Pointer Input:A, B, C, D, E, F
Output:char
ToFloatFunction<A> Function-Pointer Input:A
Output:float
ToFloatBiFunction<A,B> Function-Pointer Input:A, B
Output:float
ToFloatTriFunction<A,B,C> Function-Pointer Input:A, B, C
Output:float
ToFloatQuadFunction<A,B,C,D> Function-Pointer Input:A, B, C, D
Output:float
ToFloatQuintFunction<A,B,C,D,E> Function-Pointer Input:A, B, C, D, E
Output:float
ToFloatHexFunction<A,B,C,D,E,F> Function-Pointer Input:A, B, C, D, E, F
Output:float
ToShortFunction<A> Function-Pointer Input:A
Output:short
ToShortBiFunction<A,B> Function-Pointer Input:A, B
Output:short
ToShortTriFunction<A,B,C> Function-Pointer Input:A, B, C
Output:short
ToShortQuadFunction<A,B,C,D> Function-Pointer Input:A, B, C, D
Output:short
ToShortQuintFunction<A,B,C,D,E> Function-Pointer Input:A, B, C, D, E
Output:short
ToShortHexFunction<A,B,C,D,E,F> Function-Pointer Input:A, B, C, D, E, F
Output:short
Two Primitive Inputs Java Entity Description BiIntConsumer Function-Pointer Input:int, int
Output:void
BiIntFunction<R> Function-Pointer Input:int, int
Output:R
BiIntPredicate Function-Pointer Input:int, int
Output:boolean
IntBoolConsumer Function-Pointer Input:int, boolean
Output:void
IntBoolFunction<R> Function-Pointer Input:int, boolean
Output:R
IntBoolPredicate Function-Pointer Input:int, boolean
Output:boolean
IntByteConsumer Function-Pointer Input:int, byte
Output:void
IntByteFunction<R> Function-Pointer Input:int, byte
Output:R
IntBytePredicate Function-Pointer Input:int, byte
Output:boolean
IntDoubleConsumer Function-Pointer Input:int, double
Output:void
IntDoubleFunction<R> Function-Pointer Input:int, double
Output:R
IntDoublePredicate Function-Pointer Input:int, double
Output:boolean
IntFloatConsumer Function-Pointer Input:int, float
Output:void
IntFloatFunction<R> Function-Pointer Input:int, float
Output:R
IntFloatPredicate Function-Pointer Input:int, float
Output:boolean
IntLongConsumer Function-Pointer Input:int, long
Output:void
IntLongFunction<R> Function-Pointer Input:int, long
Output:R
IntLongPredicate Function-Pointer Input:int, long
Output:boolean
IntShortConsumer Function-Pointer Input:int, short
Output:void
IntShortFunction<R> Function-Pointer Input:int, short
Output:R
IntShortPredicate Function-Pointer Input:int, short
Output:boolean
IntCharConsumer Function-Pointer Input:int, char
Output:void
IntCharFunction<R> Function-Pointer Input:int, char
Output:R
IntCharPredicate Function-Pointer Input:int, char
Output:boolean
Primitve and Object Inputs Java Entity Description ByteTFunction<T,R> Function-Pointer Input:byte, T
Output:R
ShortTFunction<T,R> Function-Pointer Input:short, T
Output:R
IntTFunction<T,R> Function-Pointer Input:int, T
Output:R
LongTFunction<T,R> Function-Pointer Input:long, T
Output:R
FloatTFunction<T,R> Function-Pointer Input:float, T
Output:R
DoubleTFunction<T,R> Function-Pointer Input:double, T
Output:R
CharTFunction<T,R> Function-Pointer Input:chat, T
Output:R
BooleanTFunction<T,R> Function-Pointer Input:boolean, T
Output:R
Three Primitive Inputs Java Entity Description IntIntByteFunc<R> Function-Pointer Input:int, int, byte
Output:R
IntIntShortFunc<R> Function-Pointer Input:int, int, short
Output:R
TriIntFunc<R> Function-Pointer Input:int, int, int
Output:R
IntIntLongFunc<R> Function-Pointer Input:int, int, long
Output:R
IntIntFloatFunc<R> Function-Pointer Input:int, int, float
Output:R
IntIntDoubleFunc<R> Function-Pointer Input:int, int, double
Output:R
IntIntCharFunc<R> Function-Pointer Input:int, int, char
Output:R
IntIntBoolFunc<R> Function-Pointer Input:int, int, boolean
Output:R
Misc. (Used in Torello.Java) Java Entity Description IntIntTFunc<T,R> Function-Pointer Input:int, int, T
Output:R
ToCharIntCharFunc Function-Pointer Input:int, char
Output:char
ToCharIntTFunc<T> Function-Pointer Input:int, T
Output:char