org.millscript.millscript.tools
Class IntegerTools

java.lang.Object
  extended by org.millscript.millscript.tools.IntegerTools

public final class IntegerTools
extends java.lang.Object

This utility class provides simple integer based functionality to support MillScript.


Method Summary
static java.lang.Integer add(int a, java.lang.Object b)
          Returns the Integer result of adding the two specified Integers together.
static java.lang.Integer add(java.lang.Object a, int b)
          Returns the Integer result of adding the two specified Integers together.
static java.lang.Integer add(java.lang.Object a, java.lang.Object b)
          Returns the Integer result of adding the two specified Integers together.
static java.lang.Integer div(int a, java.lang.Object b)
          Returns the Integer result of dividing the first Integer by the second.
static java.lang.Integer div(java.lang.Object a, int b)
          Returns the Integer result of dividing the first Integer by the second.
static java.lang.Integer div(java.lang.Object a, java.lang.Object b)
          Returns the Integer result of dividing the first Integer by the second.
static java.lang.Integer make(int n)
          Returns an Integer for the specified int, using a shared Integer if available.
static java.lang.Integer mod(int a, java.lang.Object b)
          Returns the Integer remainder left after dividing the first Integer by the second.
static java.lang.Integer mod(java.lang.Object a, int b)
          Returns the Integer remainder left after dividing the first Integer by the second.
static java.lang.Integer mod(java.lang.Object a, java.lang.Object b)
          Returns the Integer remainder left after dividing the first Integer by the second.
static java.lang.Integer mul(int a, java.lang.Object b)
          Returns the Integer result of multiplying the two specified Integers together.
static java.lang.Integer mul(java.lang.Object a, int b)
          Returns the Integer result of multiplying the two specified Integers together.
static java.lang.Integer mul(java.lang.Object a, java.lang.Object b)
          Returns the Integer result of multiplying the two specified Integers together.
static java.lang.Integer op(java.lang.String sym, java.lang.Object x, java.lang.Object y)
          Performs a specified operation on the specified integers, using integer arithmetic.
static java.lang.Integer sub(int a, java.lang.Object b)
          Returns the Integer result of subtracting the second Integer from the first.
static java.lang.Integer sub(java.lang.Object a, int b)
          Returns the Integer result of subtracting the second Integer from the first.
static java.lang.Integer sub(java.lang.Object a, java.lang.Object b)
          Returns the Integer result of subtracting the second Integer from the first.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

make

public static java.lang.Integer make(int n)
Returns an Integer for the specified int, using a shared Integer if available.

Parameters:
n - the int to make an Integer for
Returns:
an Integer for the specified int, using a shared Integer if available

op

public static java.lang.Integer op(java.lang.String sym,
                                   java.lang.Object x,
                                   java.lang.Object y)
Performs a specified operation on the specified integers, using integer arithmetic.

Parameters:
sym - the symbol for the arithmetic operation to perform
x - the first integer
y - the second integer
Returns:
an Integer holding the result of the arithmetic operation

add

public static java.lang.Integer add(int a,
                                    java.lang.Object b)
Returns the Integer result of adding the two specified Integers together.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of adding the two values

add

public static java.lang.Integer add(java.lang.Object a,
                                    int b)
Returns the Integer result of adding the two specified Integers together.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of adding the two values

add

public static java.lang.Integer add(java.lang.Object a,
                                    java.lang.Object b)
Returns the Integer result of adding the two specified Integers together.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of adding the two values

sub

public static java.lang.Integer sub(int a,
                                    java.lang.Object b)
Returns the Integer result of subtracting the second Integer from the first.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of subtracting the second Integer from the first

sub

public static java.lang.Integer sub(java.lang.Object a,
                                    int b)
Returns the Integer result of subtracting the second Integer from the first.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of subtracting the second Integer from the first

sub

public static java.lang.Integer sub(java.lang.Object a,
                                    java.lang.Object b)
Returns the Integer result of subtracting the second Integer from the first.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of subtracting the second Integer from the first

mul

public static java.lang.Integer mul(int a,
                                    java.lang.Object b)
Returns the Integer result of multiplying the two specified Integers together.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of multiplying the two values

mul

public static java.lang.Integer mul(java.lang.Object a,
                                    int b)
Returns the Integer result of multiplying the two specified Integers together.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of multiplying the two values

mul

public static java.lang.Integer mul(java.lang.Object a,
                                    java.lang.Object b)
Returns the Integer result of multiplying the two specified Integers together.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of multiplying the two values

div

public static java.lang.Integer div(int a,
                                    java.lang.Object b)
Returns the Integer result of dividing the first Integer by the second.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of dividing the first Integer by the second

div

public static java.lang.Integer div(java.lang.Object a,
                                    int b)
Returns the Integer result of dividing the first Integer by the second.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of dividing the first Integer by the second

div

public static java.lang.Integer div(java.lang.Object a,
                                    java.lang.Object b)
Returns the Integer result of dividing the first Integer by the second.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer result of dividing the first Integer by the second

mod

public static java.lang.Integer mod(int a,
                                    java.lang.Object b)
Returns the Integer remainder left after dividing the first Integer by the second.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer remainder left after dividing the first Integer by the second

mod

public static java.lang.Integer mod(java.lang.Object a,
                                    int b)
Returns the Integer remainder left after dividing the first Integer by the second.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer remainder left after dividing the first Integer by the second

mod

public static java.lang.Integer mod(java.lang.Object a,
                                    java.lang.Object b)
Returns the Integer remainder left after dividing the first Integer by the second.

Parameters:
a - the first Integer
b - the second Integer
Returns:
the Integer remainder left after dividing the first Integer by the second


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.