Package fj.function

Class Integers

java.lang.Object
fj.function.Integers

public final class Integers extends Object
Curried functions over Integers.
  • Field Details

    • add

      public static final F<Integer,F<Integer,Integer>> add
      Curried Integer addition.
    • multiply

      public static final F<Integer,F<Integer,Integer>> multiply
      Curried Integer multiplication.
    • subtract

      public static final F<Integer,F<Integer,Integer>> subtract
      Curried Integer subtraction.
    • negate

      public static final F<Integer,Integer> negate
      Negation.
    • abs

      public static final F<Integer,Integer> abs
      Absolute value.
    • remainder

      public static final F<Integer,F<Integer,Integer>> remainder
      Remainder.
    • power

      public static final F<Integer,F<Integer,Integer>> power
      Power.
    • even

      public static final F<Integer,Boolean> even
      Evenness.
    • gtZero

      public static final F<Integer,Boolean> gtZero
      A function that returns true if the given integer is greater than zero.
    • gteZero

      public static final F<Integer,Boolean> gteZero
      A function that returns true if the given integer is greater than or equal to zero.
    • ltZero

      public static final F<Integer,Boolean> ltZero
      A function that returns true if the given integer is less than zero.
    • lteZero

      public static final F<Integer,Boolean> lteZero
      A function that returns true if the given integer is less than or equal to zero.
  • Constructor Details

    • Integers

      private Integers()
  • Method Details

    • sum

      public static int sum(List<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<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.
    • fromString

      public static F<String,Option<Integer>> fromString()
      A function that converts strings to integers.
      Returns:
      A function that converts strings to integers.