tcra.math
Class MathInteger

java.lang.Object
  extended by tcra.math.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.
 
Method Summary
 boolean equals(int val)
          Compares the stored value to the integer supplied.
 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 toHTMLString()
          In case the toString() function includes character that would not properly display in HTML, this string returns an HTML compliant version.
 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
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.

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

equals

public boolean equals(int val)
Compares the stored value to the integer supplied.

Parameters:
val - integer to compare to
Returns:
true if the values 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

toHTMLString

public java.lang.String toHTMLString()
Description copied from interface: MathType
In case the toString() function includes character that would not properly display in HTML, this string returns an HTML compliant version. For example, '<' and '>' are not rendered in HTML since they represent opening and closing a tag. To show these as text, you must use < and >.

Specified by:
toHTMLString in interface MathType
Returns:
HTML compliant version of the toString() string.