Package org.multiverse.api.functions
Class Functions
- java.lang.Object
-
- org.multiverse.api.functions.Functions
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IntFunction
decIntFunction()
Returns anIntFunction
that decrements the input value by one.static LongFunction
decLongFunction()
Returns aLongFunction
that decrements the input value by one.static BooleanFunction
identityBooleanFunction()
Returns aBooleanFunction
that returns the argument.static DoubleFunction
identityDoubleFunction()
Returns anDoubleFunction
that returns its input.static Function
identityFunction()
Returns anFunction
that returns its input.static IntFunction
identityIntFunction()
Returns an identityIntFunction
(a function that returns its input value).static LongFunction
identityLongFunction()
Returns an identityLongFunction
(a function that returns its input value).static DoubleFunction
incDoubleFunction()
Returns aDoubleFunction
that increments the input with one.static IntFunction
incIntFunction()
Returns anIntFunction
that increments the input value by one.static IntFunction
incIntFunction(int amount)
Returns aIntFunction
that increments with the given amount.static LongFunction
incLongFunction()
Returns aLongFunction
that increments the input value by one.static LongFunction
incLongFunction(long amount)
Returns aLongFunction
that increments with the given amount.static BooleanFunction
inverseBooleanFunction()
Returns aBooleanFunction
that inverts the argument.
-
-
-
Method Detail
-
identityFunction
public static Function identityFunction()
Returns anFunction
that returns its input.- Returns:
- the identity function.
-
identityDoubleFunction
public static DoubleFunction identityDoubleFunction()
Returns anDoubleFunction
that returns its input.- Returns:
- the identity function.
-
incDoubleFunction
public static DoubleFunction incDoubleFunction()
Returns aDoubleFunction
that increments the input with one.- Returns:
- the increment function.
-
identityIntFunction
public static IntFunction identityIntFunction()
Returns an identityIntFunction
(a function that returns its input value). The instance is cached.- Returns:
- the identity IntFunction.
-
identityLongFunction
public static LongFunction identityLongFunction()
Returns an identityLongFunction
(a function that returns its input value). The instance is cached.- Returns:
- the identity LongFunction.
-
incIntFunction
public static IntFunction incIntFunction()
Returns anIntFunction
that increments the input value by one. The instance is cached.- Returns:
- the increment IntFunction.
-
decIntFunction
public static IntFunction decIntFunction()
Returns anIntFunction
that decrements the input value by one. The instance is cached.- Returns:
- the decrease IntFunction.
-
incLongFunction
public static LongFunction incLongFunction()
Returns aLongFunction
that increments the input value by one. The instance is cached.- Returns:
- the increment LongFunction.
-
decLongFunction
public static LongFunction decLongFunction()
Returns aLongFunction
that decrements the input value by one. The instance is cached.- Returns:
- the decrement LongFunction.
-
incIntFunction
public static IntFunction incIntFunction(int amount)
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
public static BooleanFunction inverseBooleanFunction()
Returns aBooleanFunction
that inverts the argument.- Returns:
- the function
-
identityBooleanFunction
public static BooleanFunction identityBooleanFunction()
Returns aBooleanFunction
that returns the argument.- Returns:
- the function.
-
incLongFunction
public static LongFunction incLongFunction(long amount)
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.
-
-