    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.

##

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

##

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

##

MathInteger

     public MathInteger(int num)

  Constructs an integer number.

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.

##

equals

     public boolean equals(Object obj)

  Compares two integer numbers for equality.

  Parameters:
    obj - an integer number
  Overrides:
    equals in class Object

toString

     public String toString()

  Returns a string representing the value of this integer number.

  Overrides:
    toString in class Object

value

     public int value()

  Returns the integer value.

negate

     public AbelianGroupMember negate()

  Returns the negative of this number.

add

     public AbelianGroupMember add(AbelianGroupMember n)

  Returns the addition of this number and another.

add

     public MathInteger add(MathInteger n)

  Returns the addition of this integer number and another.

subtract

     public AbelianGroupMember subtract(AbelianGroupMember n)

  Returns the subtraction of this number and another.

subtract

     public MathInteger subtract(MathInteger n)

  Returns the subtraction of this integer number and another.

multiply

     public RingMember multiply(RingMember n)

  Returns the multiplication of this number and another.

multiply

     public MathInteger multiply(MathInteger n)

  Returns the multiplication of this integer number and another.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index