Available Interfaces
All interfaces are part of the zenscriptx.fun
package, meaning that the fully qualified name for a class X
is
zenscriptx.fun.X
, which is useful for importing.
In the following list, functions are split into categories that represent what their general use is. Also, in all of the
functions definitions, the letters T
, U
, and R
define generic types, i.e. types that can be specified by the
developer.
BiConsumers
A BiConsumer accepts two elements, which can be of different types, and consumes them, meaning uses them for internal processing and returns nothing.
Class Name | Function Signature | Notes |
---|---|---|
Class Name BiConsumer | Function Signature function accept(t as T, u as U) as void; | Notes - |
Class Name ObjDoubleConsumer | Function Signature function accept(t as T, value as double) as void; | Notes - |
Class Name ObjIntConsumer | Function Signature function accept(t as T, value as int) as void; | Notes - |
Class Name ObjLongConsumer | Function Signature function accept(t as T, value as long) as void; | Notes - |
BiFunctions
A BiFunction applies a function to two elements, which can be of different types, returning a single element, which can
also be of a different type. It can be pictured mathematically as r = f(s, t)
, where f
is the bifunction.
Class Name | Function Signature | Notes |
---|---|---|
Class Name BiFunction | Function Signature function apply(t as T, u as U) as R; | Notes - |
Class Name ToDoubleBiFunction | Function Signature function apply(t as T, u as U) as double; | Notes - |
Class Name ToIntBiFunction | Function Signature function apply(t as T, u as U) as int; | Notes - |
Class Name ToLongBiFunction | Function Signature function apply(t as T, u as U) as long; | Notes - |
Binary Operators
A Binary Operator applies a function to two elements of the same type, returning another element, which has the
same type as the inputs. It can be mathematically pictured as r = s op t
, where op
is the binary operator.
Class Name | Function Signature | Notes |
---|---|---|
Class Name BinaryOperator | Function Signature function apply(t as T, u as T) as T; | Notes BinaryOperator extends BiFunction |
Class Name DoubleBinaryOperator | Function Signature function applyAsDouble(left as double, right as double) as double; | Notes - |
Class Name IntBinaryOperator | Function Signature function applyAsInt(left as int, right as int) as int; | Notes - |
Class Name LongBinaryOperator | Function Signature function applyAsLong(left as long, right as long) as long; | Notes - |
BiPredicates
A BiPredicate tests the two given inputs, which may be of different types, and returns a boolean, representing whether they passed the test or not.
Class Name | Function Signature | Notes |
---|---|---|
Class Name BiPredicate | Function Signature function test(t as T, u as U) as bool; | Notes - |
Consumers
A Consumer accepts a single element and consumes it, meaning it uses it for internal processing and returns nothing.
Class Name | Function Signature | Notes |
---|---|---|
Class Name Consumer | Function Signature function accept(t as T) as void; | Notes - |
Class Name DoubleConsumer | Function Signature function accept(value as double) as void; | Notes - |
Class Name IntConsumer | Function Signature function accept(value as int) as void; | Notes - |
Class Name LongConsumer | Function Signature function accept(value as long) as void; | Notes - |
Functions
A Function applies a function to a single element, returning another element, which can be a different type from the
inputs. It can be pictured mathematically as r = f(t)
, where f
is the function.
Class Name | Function Signature | Notes |
---|---|---|
Class Name Function | Function Signature function apply(t as T) as R; | Notes - |
Class Name DoubleFunction | Function Signature function apply(value as double) as R; | Notes - |
Class Name DoubleToIntFunction | Function Signature function applyAsInt(value as double) as int; | Notes - |
Class Name DoubleToLongFunction | Function Signature function applyAsLong(value as double) as long; | Notes - |
Class Name IntFunction | Function Signature function apply(value as int) as R; | Notes - |
Class Name IntToDoubleFunction | Function Signature function applyAsDouble(value as int) as double; | Notes - |
Class Name IntToLongFunction | Function Signature function applyAsLong(value as int) as long; | Notes - |
Class Name LongFunction | Function Signature function apply(value as long) as R; | Notes - |
Class Name LongToDoubleFunction | Function Signature function applyAsDouble(value as long) as double; | Notes - |
Class Name LongToIntFunction | Function Signature function applyAsInt(value as long) as int; | Notes - |
Class Name ToDoubleFunction | Function Signature function apply(value as T) as double; | Notes - |
Class Name ToIntFunction | Function Signature function apply(value as T) as int; | Notes - |
Class Name ToLongFunction | Function Signature function apply(value as T) as long; | Notes - |
Predicates
A Predicate tests the given input and returns a boolean, representing whether it passed the test or not.
Class Name | Function Signature | Notes |
---|---|---|
Class Name Predicate | Function Signature function test(t as T) as bool; | Notes - |
Class Name DoublePredicate | Function Signature function test(value as double) as bool; | Notes - |
Class Name IntPredicate | Function Signature function test(value as int) as bool; | Notes - |
Class Name LongPredicate | Function Signature function test(value as long) as bool; | Notes - |
Suppliers
A Supplier outputs an instance of a given type, be it either created on the fly or cached.
Class Name | Function Signature | Notes |
---|---|---|
Class Name Supplier | Function Signature function get() as T; | Notes - |
Class Name BooleanSupplier | Function Signature function getAsBoolean() as bool; | Notes - |
Class Name DoubleSupplier | Function Signature function getAsDouble() as double; | Notes - |
Class Name IntSupplier | Function Signature function getAsInt() as int; | Notes - |
Class Name LongSupplier | Function Signature function getAsLong() as long; | Notes - |
Unary Operators
A Unary operator applies a function to an element of a given type, returning another element, which has to be of the
same type as the inputs. It can be pictured mathematically as r = op t
, where op
is the unary operator.
Class Name | Function Signature | Notes |
---|---|---|
Class Name UnaryOperator | Function Signature function apply(t as T) as T; | Notes UnaryOperator extends Function |
Class Name DoubleUnaryOperator | Function Signature function applyAsDouble(operand as double) as double; | Notes - |
Class Name IntUnaryOperator | Function Signature function applyAsInt(operand as int) as int; | Notes - |
Class Name LongUnaryOperator | Function Signature function applyAsLong(operand as long) as long; | Notes - |