Package fj.function
Class Integers
- java.lang.Object
-
- fj.function.Integers
-
public final class Integers extends java.lang.Object
Curried functions over Integers.
-
-
Field Summary
Fields Modifier and Type Field Description static F<java.lang.Integer,java.lang.Integer>
abs
Absolute value.static F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>>
add
Curried Integer addition.static F<java.lang.Integer,java.lang.Boolean>
even
Evenness.static F<java.lang.Integer,java.lang.Boolean>
gteZero
A function that returns true if the given integer is greater than or equal to zero.static F<java.lang.Integer,java.lang.Boolean>
gtZero
A function that returns true if the given integer is greater than zero.static F<java.lang.Integer,java.lang.Boolean>
lteZero
A function that returns true if the given integer is less than or equal to zero.static F<java.lang.Integer,java.lang.Boolean>
ltZero
A function that returns true if the given integer is less than zero.static F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>>
multiply
Curried Integer multiplication.static F<java.lang.Integer,java.lang.Integer>
negate
Negation.static F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>>
power
Power.static F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>>
remainder
Remainder.static F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>>
subtract
Curried Integer subtraction.
-
Constructor Summary
Constructors Modifier Constructor Description private
Integers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static F<java.lang.String,Option<java.lang.Integer>>
fromString()
A function that converts strings to integers.static int
product(List<java.lang.Integer> ints)
Returns the product of a list of integers.static int
sum(List<java.lang.Integer> ints)
Sums a list of integers.
-
-
-
Field Detail
-
add
public static final F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>> add
Curried Integer addition.
-
multiply
public static final F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>> multiply
Curried Integer multiplication.
-
subtract
public static final F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>> subtract
Curried Integer subtraction.
-
negate
public static final F<java.lang.Integer,java.lang.Integer> negate
Negation.
-
abs
public static final F<java.lang.Integer,java.lang.Integer> abs
Absolute value.
-
remainder
public static final F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>> remainder
Remainder.
-
power
public static final F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>> power
Power.
-
even
public static final F<java.lang.Integer,java.lang.Boolean> even
Evenness.
-
gtZero
public static final F<java.lang.Integer,java.lang.Boolean> gtZero
A function that returns true if the given integer is greater than zero.
-
gteZero
public static final F<java.lang.Integer,java.lang.Boolean> gteZero
A function that returns true if the given integer is greater than or equal to zero.
-
ltZero
public static final F<java.lang.Integer,java.lang.Boolean> ltZero
A function that returns true if the given integer is less than zero.
-
lteZero
public static final F<java.lang.Integer,java.lang.Boolean> lteZero
A function that returns true if the given integer is less than or equal to zero.
-
-
Method Detail
-
sum
public static int sum(List<java.lang.Integer> ints)
Sums a list of integers.- Parameters:
ints
- A list of integers to sum.- Returns:
- The sum of the integers in the list.
-
product
public static int product(List<java.lang.Integer> ints)
Returns the product of a list of integers.- Parameters:
ints
- A list of integers to multiply together.- Returns:
- The product of the integers in the list.
-
-