org.jscience.ml.openmath
Class OMInteger

java.lang.Object
  extended by org.jscience.ml.openmath.OMObject
      extended by org.jscience.ml.openmath.OMInteger
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class OMInteger
extends OMObject

Models an OpenMath integer.

See Also:
"The OpenMath standard 2.0, 2.1.1", Serialized Form

Field Summary
protected  java.lang.String integer
          Stores the integer.
 
Fields inherited from class org.jscience.ml.openmath.OMObject
attributes
 
Constructor Summary
OMInteger()
          Constructor.
OMInteger(int newInteger)
          Constructor.
OMInteger(java.lang.Integer newInteger)
          Constructor.
OMInteger(long newLong)
          Constructor.
OMInteger(java.lang.Long newLong)
          Constructor.
OMInteger(java.lang.String newInteger)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          Clones the object (shallow copy).
 java.lang.Object copy()
          Copies the object (full copy).
 java.lang.String getInteger()
          Get the integer.
 java.lang.String getType()
          Gets the type.
 int intValue()
          Returns the integer as an int.
 boolean isAtom()
          Is this an atom object.
 boolean isComposite()
          Is this a composite object.
 boolean isSame(OMObject object)
          Determines if this is the same object.
 boolean isValid()
          Determines if this object is valid.
 long longValue()
          Return the integer as a long.
 void setInteger(int newInteger)
          Set the integer.
 void setInteger(java.lang.Integer newInteger)
          Set the integer.
 void setInteger(long newLong)
          Set the integer.
 void setInteger(java.lang.Long newLong)
          Set the integer.
 void setInteger(java.lang.String newInteger)
          Set the integer.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.jscience.ml.openmath.OMObject
getAttribute, getAttributes, removeAttribute, setAttribute, setAttributes
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

integer

protected java.lang.String integer
Stores the integer.

Constructor Detail

OMInteger

public OMInteger()
Constructor.


OMInteger

public OMInteger(java.lang.String newInteger)
Constructor.

Parameters:
newInteger - the integer to set (as a string).

OMInteger

public OMInteger(long newLong)
Constructor.

Parameters:
newLong - the long to use for this OpenMath integer.

OMInteger

public OMInteger(int newInteger)
Constructor.

Parameters:
newInteger - the int to use for this OpenMath integer.

OMInteger

public OMInteger(java.lang.Long newLong)
Constructor.

Parameters:
newLong - the Long to use for this OpenMath integer.

OMInteger

public OMInteger(java.lang.Integer newInteger)
Constructor.

Parameters:
newInteger - the Integer to use for this OpenMath integer.
Method Detail

getType

public java.lang.String getType()
Gets the type.

Specified by:
getType in class OMObject
Returns:
the type.

setInteger

public void setInteger(java.lang.String newInteger)
Set the integer.

Parameters:
newInteger - the integer to set (as string).

setInteger

public void setInteger(java.lang.Long newLong)
Set the integer.

Parameters:
newLong - the integer to set (as Long).

setInteger

public void setInteger(java.lang.Integer newInteger)
Set the integer.

Parameters:
newInteger - the integer to set (as Integer).

setInteger

public void setInteger(long newLong)
Set the integer.

Parameters:
newLong - the integer to set (as Long).

setInteger

public void setInteger(int newInteger)
Set the integer.

Parameters:
newInteger - the integer to set (as int).

getInteger

public java.lang.String getInteger()
Get the integer.

Returns:
the integer (as String).

longValue

public long longValue()
Return the integer as a long.

Returns:
the integer (as long).

intValue

public int intValue()
Returns the integer as an int.

Returns:
the integer (as int).

isAtom

public boolean isAtom()
Is this an atom object.

Specified by:
isAtom in class OMObject
Returns:
true because we are an atom.

isComposite

public boolean isComposite()
Is this a composite object.

Specified by:
isComposite in class OMObject
Returns:
false because we are not composite.

toString

public java.lang.String toString()
Returns a string representation of the object.

Specified by:
toString in class OMObject
Returns:
the string representation.

clone

public java.lang.Object clone()
Clones the object (shallow copy).

Specified by:
clone in class OMObject
Returns:
the shallow copy.

copy

public java.lang.Object copy()
Copies the object (full copy).

Specified by:
copy in class OMObject
Returns:
the deep copy.

isSame

public boolean isSame(OMObject object)
Determines if this is the same object.

Specified by:
isSame in class OMObject
Parameters:
object - the object to test against.
Returns:
true if it is the same, false if not.

isValid

public boolean isValid()
Determines if this object is valid.

Specified by:
isValid in class OMObject
Returns:
true if it is valid, false if it is not.