info.javelot.functionalj.util
Class Operators

java.lang.Object
  extended byinfo.javelot.functionalj.util.Operators

public final class Operators
extends Object

Contains method definitions for operators along with their corresponding functions.

Author:
Copyright © 2006 Frederic Daoud

Field Summary
static Function add
          Function that corresponds to the add(int,int) method.
static Function and
          Function that corresponds to the and(boolean,boolean) method.
static Function concat
          Function that corresponds to the concat(String,String) method.
static Function divide
          Function that corresponds to the divide(int,int) method.
static Function multiply
          Function that corresponds to the multiply(int,int) method.
static Function not
          Function that corresponds to the not(boolean) method.
static Function or
          Function that corresponds to the or(boolean,boolean) method.
static Function subtract
          Function that corresponds to the subtract(int,int) method.
 
Method Summary
static int add(int p_first, int p_second)
          Method that corresponds to the + operator.
static boolean and(boolean p_first, boolean p_second)
          Method that corresponds to the && operator.
static String concat(String p_first, String p_second)
          Method that corresponds to the + operator as it pertains to concatenating two Strings.
static int divide(int p_first, int p_second)
          Method that corresponds to the / operator.
static int multiply(int p_first, int p_second)
          Method that corresponds to the * operator.
static boolean not(boolean p_parameter)
          Method that corresponds to the boolean 'not' operator.
static boolean or(boolean p_first, boolean p_second)
          Method that corresponds to the || operator.
static int subtract(int p_first, int p_second)
          Method that corresponds to the - operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

add

public static final Function add
Function that corresponds to the add(int,int) method.


multiply

public static final Function multiply
Function that corresponds to the multiply(int,int) method.


subtract

public static final Function subtract
Function that corresponds to the subtract(int,int) method.


divide

public static final Function divide
Function that corresponds to the divide(int,int) method.


and

public static final Function and
Function that corresponds to the and(boolean,boolean) method.


or

public static final Function or
Function that corresponds to the or(boolean,boolean) method.


not

public static final Function not
Function that corresponds to the not(boolean) method.


concat

public static final Function concat
Function that corresponds to the concat(String,String) method.

Method Detail

add

public static int add(int p_first,
                      int p_second)
Method that corresponds to the + operator.

Parameters:
p_first - the first parameter to the + operator.
p_second - the second parameter to the + operator.
Returns:
the result of applying the + operator to the two parameters.

multiply

public static int multiply(int p_first,
                           int p_second)
Method that corresponds to the * operator.

Parameters:
p_first - the first parameter to the * operator.
p_second - the second parameter to the * operator.
Returns:
the result of applying the * operator to the two parameters.

subtract

public static int subtract(int p_first,
                           int p_second)
Method that corresponds to the - operator.

Parameters:
p_first - the first parameter to the - operator.
p_second - the second parameter to the - operator.
Returns:
the result of applying the - operator to the two parameters.

divide

public static int divide(int p_first,
                         int p_second)
Method that corresponds to the / operator.

Parameters:
p_first - the first parameter to the / operator.
p_second - the second parameter to the / operator.
Returns:
the result of applying the / operator to the two parameters.

and

public static boolean and(boolean p_first,
                          boolean p_second)
Method that corresponds to the && operator.

Parameters:
p_first - the first parameter to the && operator.
p_second - the second parameter to the && operator.
Returns:
the result of applying the && operator to the two parameters.

or

public static boolean or(boolean p_first,
                         boolean p_second)
Method that corresponds to the || operator.

Parameters:
p_first - the first parameter to the || operator.
p_second - the second parameter to the || operator.
Returns:
the result of applying the || operator to the two parameters.

not

public static boolean not(boolean p_parameter)
Method that corresponds to the boolean 'not' operator. This is represented by the symbol '!'.

Parameters:
p_parameter - the parameter to the not operator.
Returns:
the result of applying the not operator to the parameter.

concat

public static String concat(String p_first,
                            String p_second)
Method that corresponds to the + operator as it pertains to concatenating two Strings.

Parameters:
p_first - the first parameter to the + operator.
p_second - the second parameter to the + operator.
Returns:
the result of applying the + operator to the two parameters.