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 classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final IntFunctionprivate static final LongFunctionprivate static final BooleanFunctionprivate static final DoubleFunctionprivate static final Functionprivate static final IntFunctionprivate static final LongFunctionprivate static final DoubleFunctionprivate static final IntFunctionprivate static final LongFunctionprivate static final BooleanFunction -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IntFunctionReturns anIntFunctionthat decrements the input value by one.static LongFunctionReturns aLongFunctionthat decrements the input value by one.static BooleanFunctionReturns aBooleanFunctionthat returns the argument.static DoubleFunctionReturns anDoubleFunctionthat returns its input.static FunctionReturns anFunctionthat returns its input.static IntFunctionReturns an identityIntFunction(a function that returns its input value).static LongFunctionReturns an identityLongFunction(a function that returns its input value).static DoubleFunctionReturns aDoubleFunctionthat increments the input with one.static IntFunctionReturns anIntFunctionthat increments the input value by one.static IntFunctionincIntFunction(int amount) Returns aIntFunctionthat increments with the given amount.static LongFunctionReturns aLongFunctionthat increments the input value by one.static LongFunctionincLongFunction(long amount) Returns aLongFunctionthat increments with the given amount.static BooleanFunctionReturns aBooleanFunctionthat 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 anFunctionthat returns its input.- Returns:
- the identity function.
-
identityDoubleFunction
Returns anDoubleFunctionthat returns its input.- Returns:
- the identity function.
-
incDoubleFunction
Returns aDoubleFunctionthat 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 anIntFunctionthat increments the input value by one. The instance is cached.- Returns:
- the increment IntFunction.
-
decIntFunction
Returns anIntFunctionthat decrements the input value by one. The instance is cached.- Returns:
- the decrease IntFunction.
-
incLongFunction
Returns aLongFunctionthat increments the input value by one. The instance is cached.- Returns:
- the increment LongFunction.
-
decLongFunction
Returns aLongFunctionthat decrements the input value by one. The instance is cached.- Returns:
- the decrement LongFunction.
-
incIntFunction
Returns aIntFunctionthat 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 aBooleanFunctionthat inverts the argument.- Returns:
- the function
-
identityBooleanFunction
Returns aBooleanFunctionthat returns the argument.- Returns:
- the function.
-
incLongFunction
Returns aLongFunctionthat 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.
-