Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.

fj.function
Class Integers

java.lang.Object
  extended by fj.function.Integers

public final class Integers
extends Object

Curried functions over Integers.


Field Summary
static F<Integer,Integer> abs
          Absolute value.
static F<Integer,F<Integer,Integer>> add
          Curried Integer addition.
static F<Integer,Boolean> even
          Evenness.
static F<Integer,F<Integer,Integer>> multiply
          Curried Integer multiplication.
static F<Integer,Integer> negate
          Negation.
static F<Integer,F<Integer,Integer>> power
          Power.
static F<Integer,F<Integer,Integer>> remainder
          Remainder.
static F<Integer,F<Integer,Integer>> subtract
          Curried Integer subtraction.
 
Method Summary
static F<String,Option<Integer>> fromString()
          A function that converts strings to integers.
static int product(List<Integer> ints)
          Returns the product of a list of integers.
static int sum(List<Integer> ints)
          Sums a list of integers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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.

Method Detail

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.

Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.