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