Version: 1.1.1

org.biomoby.shared.datatypes
Class MobyInteger

java.lang.Object
  extended by org.biomoby.shared.datatypes.MobyObject
      extended by org.biomoby.shared.datatypes.MobyInteger

public class MobyInteger
extends MobyObject

An object representing an Integer, a Moby primitive data type.

The value of this object is stored internally as a string, but during setting it (setValue(java.lang.String)) it checks for its numeric and integer value.

Version:
$Id: MobyInteger.java,v 1.1 2005/08/26 06:27:05 senger Exp $
Author:
Martin Senger

Constructor Summary
MobyInteger()
          Default constructor.
MobyInteger(long value)
          Another constructor.
 
Method Summary
 long getIntValue()
          Return the value of this object as a numeric object (long).
 void setValue(String value)
          Additionally to the same method in the superclass, it checks for numerical and integer value (its length is not limited - internaly it uses BigInteger object).
 org.jdom.Element toXML()
          Create an XML element representing this object.
 
Methods inherited from class org.biomoby.shared.datatypes.MobyObject
addXref, format, getId, getMobyTypeName, getName, getNamespace, getProvision, getValue, getXrefs, isPrimitiveType, setId, setName, setNamespace, setProvision, setValueXML, setXrefs, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MobyInteger

public MobyInteger()
Default constructor.


MobyInteger

public MobyInteger(long value)
Another constructor.

Parameters:
value - will become the value of this object. If a bigger number is to be stored then use setValue(String).
Method Detail

toXML

public org.jdom.Element toXML()
Description copied from class: MobyObject
Create an XML element representing this object.

Overrides:
toXML in class MobyObject
Returns:
a jDom element that can be easily incorporated into a bigger XML document

setValue

public void setValue(String value)
              throws MobyException
Additionally to the same method in the superclass, it checks for numerical and integer value (its length is not limited - internaly it uses BigInteger object).

Overrides:
setValue in class MobyObject
Parameters:
value - to be stored
Throws:
MobyException - if the 'value' is not numeric (which includes the case when it is an empty string)
See Also:
how to set value as CDATA

getIntValue

public long getIntValue()
                 throws MobyException
Return the value of this object as a numeric object (long).

Throws:
MobyException - if the value is too big to be stored in as Java's long.
See Also:
MobyObject.getValue()

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010