Package org.multiverse.api.functions
Class Functions
java.lang.Object
org.multiverse.api.functions.Functions
A utility class for
Function
functionality.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final IntFunction
private static final LongFunction
private static final BooleanFunction
private static final DoubleFunction
private static final Function
private static final IntFunction
private static final LongFunction
private static final DoubleFunction
private static final IntFunction
private static final LongFunction
private static final BooleanFunction
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IntFunction
Returns anIntFunction
that decrements the input value by one.static LongFunction
Returns aLongFunction
that decrements the input value by one.static BooleanFunction
Returns aBooleanFunction
that returns the argument.static DoubleFunction
Returns anDoubleFunction
that returns its input.static Function
Returns anFunction
that returns its input.static IntFunction
Returns an identityIntFunction
(a function that returns its input value).static LongFunction
Returns an identityLongFunction
(a function that returns its input value).static DoubleFunction
Returns aDoubleFunction
that increments the input with one.static IntFunction
Returns anIntFunction
that increments the input value by one.static IntFunction
incIntFunction
(int amount) Returns aIntFunction
that increments with the given amount.static LongFunction
Returns aLongFunction
that increments the input value by one.static LongFunction
incLongFunction
(long amount) Returns aLongFunction
that increments with the given amount.static BooleanFunction
Returns aBooleanFunction
that inverts the argument.
-
Field Details
-
incOneIntFunction
-
incOneLongFunction
-
decOneIntFunction
-
decOneLongFunction
-
incOneDoubleFunction
-
identityDoubleFunction
-
inverseBooleanFunction
-
identityBooleanFunction
-
identityIntFunction
-
identityLongFunction
-
identityFunction
-
-
Constructor Details
-
Functions
private Functions()
-
-
Method Details
-
identityFunction
Returns anFunction
that returns its input.- Returns:
- the identity function.
-
identityDoubleFunction
Returns anDoubleFunction
that returns its input.- Returns:
- the identity function.
-
incDoubleFunction
Returns aDoubleFunction
that increments the input with one.- Returns:
- the increment function.
-
identityIntFunction
Returns an identityIntFunction
(a function that returns its input value). The instance is cached.- Returns:
- the identity IntFunction.
-
identityLongFunction
Returns an identityLongFunction
(a function that returns its input value). The instance is cached.- Returns:
- the identity LongFunction.
-
incIntFunction
Returns anIntFunction
that increments the input value by one. The instance is cached.- Returns:
- the increment IntFunction.
-
decIntFunction
Returns anIntFunction
that decrements the input value by one. The instance is cached.- Returns:
- the decrease IntFunction.
-
incLongFunction
Returns aLongFunction
that increments the input value by one. The instance is cached.- Returns:
- the increment LongFunction.
-
decLongFunction
Returns aLongFunction
that decrements the input value by one. The instance is cached.- Returns:
- the decrement LongFunction.
-
incIntFunction
Returns aIntFunction
that increments with the given amount. For the -1, 0 and 1 a cached instance is returned. In the other cases a new instance is created.- Parameters:
amount
- the value to increment with. A negative value does a decrement.- Returns:
- the increment IntFunction.
-
inverseBooleanFunction
Returns aBooleanFunction
that inverts the argument.- Returns:
- the function
-
identityBooleanFunction
Returns aBooleanFunction
that returns the argument.- Returns:
- the function.
-
incLongFunction
Returns aLongFunction
that increments with the given amount. For the -1, 0 and 1 a cached instance is returned. In the other cases a new instance is created.- Parameters:
amount
- the value to increment with. A negative value does a decrement.- Returns:
- the increment LongFunction.
-