|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.biomoby.shared.MobyData org.biomoby.shared.MobyPrimaryData org.biomoby.shared.MobyPrimaryDataSimple org.biomoby.shared.data.MobyDataObject org.biomoby.shared.data.MobyDataInt
public class MobyDataInt
A class representing a MOBY Integer primitive. Note that the Integer notion in MOBY does not define a specific bit precision. All values in this class are stored as Java BigInteger, which has no minmum or maximum value, to avoid loss of data integrity. Because getObject() will return an immutable BigInteger, basic arithmetic methods have been included to allow modification of the underlying value.
Field Summary |
---|
Fields inherited from interface org.biomoby.shared.data.MobyDataInstance |
---|
CENTRAL_XML_MODE, SERVICE_XML_MODE |
Constructor Summary | |
---|---|
MobyDataInt(Element element)
Construct the object using a DOM fragment. |
|
MobyDataInt(Element element,
Registry registry)
|
|
MobyDataInt(int i)
|
|
MobyDataInt(Number n)
|
|
MobyDataInt(Number n,
Registry r)
|
|
MobyDataInt(String articleName,
int i)
Constructor to use if the incoming value is a primitive. |
|
MobyDataInt(String articleName,
int i,
Registry registry)
|
|
MobyDataInt(String articleName,
Number n)
Constructor to use if the incoming value is a number object such as Float, Double, Integer, BigInteger, BigDecimal, etc. |
|
MobyDataInt(String articleName,
Number n,
Registry registry)
|
|
MobyDataInt(String articleName,
String stringNumber)
Constructor to use if the incoming value is a string representing an integer number. |
|
MobyDataInt(String articleName,
String stringNumber,
Registry registry)
|
Method Summary | |
---|---|
void |
add(Number n)
Perform the addition operand on the data value. |
MobyDataInt |
clone()
Simply calls new constructor with object's existing data type, name and value. |
int |
compareTo(Object object)
Override BigInteger.compareTo() because it only compares to other BigInteger. |
void |
divide(Number n)
Perform the division operand on the data value. |
Object |
getObject()
Gives access to the Java object instance underlying the MobyData instance. |
String |
getValue()
A lexical (prefereably human readable) representation of the underlying object value (not including the namespace and ID). |
int |
intValue()
A convenience method, which returns the underlying BigInteger's primitive int representation. |
long |
longValue()
A convenience method, which returns the underlying BigInteger's primitive int representation. |
void |
mod(Number n)
Perform the modulus operand on the data value. |
void |
multiply(Number n)
Perform the multiplication operand on the data value. |
void |
pow(Number n)
Raise the stored value to an exponent. |
void |
subtract(Number n)
Perform the subtraction operand on the data value. |
String |
toXML()
Produces a full-blown XML fragment that depending on the value of getXmlMode() is either a template for use in MOBY Central services, or a Simple element for use in calling a service instance. |
Methods inherited from class org.biomoby.shared.data.MobyDataObject |
---|
addCrossReference, addCrossReferences, addCrossReferences, addProvisionInfo, createInstanceFromDOM, createInstanceFromDOM, createInstanceFromString, createInstanceFromString, createInstanceFromXML, equals, getCrossReferences, getId, getName, getPrimaryNamespace, getProvisionInfo, getTextContents, getXmlMode, hasCrossReferences, setId, setName, setPrimaryNamespace, setProvisionInfo, setXmlMode, toString |
Methods inherited from class org.biomoby.shared.MobyPrimaryDataSimple |
---|
addNamespace, format, getDataType, getNamespaces, removeNamespace, removeNamespace, setDataType, setNamespaces |
Methods inherited from class org.biomoby.shared.MobyPrimaryData |
---|
isPrimary |
Methods inherited from class org.biomoby.shared.MobyData |
---|
getId, getName, getUserData, setUserData |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.biomoby.shared.data.MobyDataInstance |
---|
getName, getUserData, setUserData |
Constructor Detail |
---|
public MobyDataInt(Element element) throws IllegalArgumentException
IllegalArgumentException
- if the element is not a Integer tagpublic MobyDataInt(Element element, Registry registry) throws IllegalArgumentException
IllegalArgumentException
public MobyDataInt(String articleName, Number n)
public MobyDataInt(String articleName, Number n, Registry registry)
public MobyDataInt(Number n)
public MobyDataInt(Number n, Registry r)
public MobyDataInt(String articleName, int i)
public MobyDataInt(String articleName, int i, Registry registry)
public MobyDataInt(int i)
public MobyDataInt(String articleName, String stringNumber) throws NumberFormatException
NumberFormatException
- if the string does not represent an integer numberpublic MobyDataInt(String articleName, String stringNumber, Registry registry) throws NumberFormatException
NumberFormatException
Method Detail |
---|
public void add(Number n)
public void subtract(Number n)
public void multiply(Number n)
public void divide(Number n)
public void mod(Number n)
public void pow(Number n)
public MobyDataInt clone()
MobyDataObject
clone
in class MobyDataObject
public int compareTo(Object object)
compareTo
in interface Comparable
compareTo
in class MobyDataObject
public Object getObject()
MobyDataObject
getObject
in interface MobyDataInstance
getObject
in class MobyDataObject
public int intValue()
public long longValue()
public String getValue()
MobyDataObject
getValue
in class MobyDataObject
public String toXML()
MobyDataObject
toXML
in interface MobyDataInstance
toXML
in class MobyDataObject
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |