tcra
Class MathInteger

java.lang.Object
  extended by tcra.MathInteger
All Implemented Interfaces:
MathType

public class MathInteger
extends java.lang.Object
implements MathType

MathInteger is the mathematical representation of an integer inside another MathType or an integer argument to a method.


Constructor Summary
MathInteger(int val)
          Constructor specifying the value of the integer.
MathInteger(int val, MathIntegerParser mip)
          Constructor specifying the value of the integer and the MathIntegerParser that parsed it from a String.
 
Method Summary
 boolean equals(java.lang.Object other)
          Checks if the MathInteger representation of an integer and the stored integer value are equal.
 int getValue()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MathInteger

public MathInteger(int val)
Constructor specifying the value of the integer. The MathIntegerParser of the MathInteger is constructed fresh.

Parameters:
val - Integer value

MathInteger

public MathInteger(int val,
                   MathIntegerParser mip)
Constructor specifying the value of the integer and the MathIntegerParser that parsed it from a String.

Parameters:
val - Integer value
mip - MathIntegerParser that parsed the MathInteger from a String.
Method Detail

equals

public boolean equals(java.lang.Object other)
Checks if the MathInteger representation of an integer and the stored integer value are equal.

Specified by:
equals in interface MathType
Overrides:
equals in class java.lang.Object
Parameters:
other - MathInteger that this is to be compared to.
Returns:
true if the stored value and the other MathString's value are equal false otherwise

getValue

public int getValue()
Returns:
Integer value of the MathInteger.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object