All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.MathInteger

java.lang.Object
   |
   +----JSci.maths.MathInteger

public final class MathInteger
extends Object
implements RingMember, Serializable
The MathInteger class encapsulates integer numbers.


Constructor Index

 o MathInteger(int)
Constructs an integer number.
 o MathInteger(String)
Constructs the integer number represented by a string.

Method Index

 o add(AbelianGroupMember)
Returns the addition of this number and another.
 o add(MathInteger)
Returns the addition of this integer number and another.
 o equals(Object)
Compares two integer numbers for equality.
 o multiply(MathInteger)
Returns the multiplication of this integer number and another.
 o multiply(RingMember)
Returns the multiplication of this number and another.
 o negate()
Returns the negative of this number.
 o subtract(AbelianGroupMember)
Returns the subtraction of this number and another.
 o subtract(MathInteger)
Returns the subtraction of this integer number and another.
 o toString()
Returns a string representing the value of this integer number.
 o value()
Returns the integer value.

Constructors

 o MathInteger
 public MathInteger(int num)
Constructs an integer number.

 o MathInteger
 public MathInteger(String s) throws NumberFormatException
Constructs the integer number represented by a string.

Parameters:
s - a string representing an integer number
Throws: NumberFormatException
if the string does not contain a parsable number.

Methods

 o equals
 public boolean equals(Object obj)
Compares two integer numbers for equality.

Parameters:
obj - an integer number
Overrides:
equals in class Object
 o toString
 public String toString()
Returns a string representing the value of this integer number.

Overrides:
toString in class Object
 o value
 public int value()
Returns the integer value.

 o negate
 public AbelianGroupMember negate()
Returns the negative of this number.

 o add
 public AbelianGroupMember add(AbelianGroupMember n)
Returns the addition of this number and another.

 o add
 public MathInteger add(MathInteger n)
Returns the addition of this integer number and another.

 o subtract
 public AbelianGroupMember subtract(AbelianGroupMember n)
Returns the subtraction of this number and another.

 o subtract
 public MathInteger subtract(MathInteger n)
Returns the subtraction of this integer number and another.

 o multiply
 public RingMember multiply(RingMember n)
Returns the multiplication of this number and another.

 o multiply
 public MathInteger multiply(MathInteger n)
Returns the multiplication of this integer number and another.


All Packages  Class Hierarchy  This Package  Previous  Next  Index