|
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.MobyDataFloat
public class MobyDataFloat
A class representing a MOBY Float primitive. Note that the Float notion in MOBY does not define a specific bit precision. All values in this class are stored as Java BigDecimal, which is arbitary precision to avoid loss of data integrity. Because getObject() will return an immutable BigDecimal, 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 | |
---|---|
MobyDataFloat(double d)
|
|
MobyDataFloat(double d,
Registry r)
|
|
MobyDataFloat(Element element)
Construct the object using a DOM fragment. |
|
MobyDataFloat(Element element,
Registry registry)
|
|
MobyDataFloat(Number n)
|
|
MobyDataFloat(Number n,
Registry r)
|
|
MobyDataFloat(String stringNumber)
|
|
MobyDataFloat(String articleName,
double d)
Constructor to use if the incoming value is a primitive. |
|
MobyDataFloat(String articleName,
double d,
Registry registry)
|
|
MobyDataFloat(String articleName,
Number n)
Constructor to use if the incoming value is a number object such as Float, Double, Integer, BigDecimal, etc. |
|
MobyDataFloat(String articleName,
Number n,
Registry r)
|
|
MobyDataFloat(String stringNumber,
Registry registry)
|
|
MobyDataFloat(String articleName,
String stringNumber)
Constructor to use if the incoming value is a string representing a number (including mantissa/exponent format). |
|
MobyDataFloat(String articleName,
String stringNumber,
Registry registry)
|
Method Summary | |
---|---|
void |
add(Number n)
Add a specified number to the data value. |
MobyDataFloat |
clone()
Simply calls new constructor with object's existing data type, name and value. |
int |
compareTo(Object object)
Override BigDecimal.compareTo() because it only compares to other BigInteger. |
void |
divide(Number n)
Divide the data value by a number n, using the rounding off mode BigDecimal.ROUND_HALF_EVEN. |
void |
divide(Number n,
int mode)
Divide the data value by a number n, using the rounding off mode of your choice from BigDecimal. |
double |
doubleValue()
A convenience method, which returns the underlying BigInteger's primitive int representation. |
boolean |
equals(Object object)
Override BigDecimal.equals() because it only compares to other BigInteger. |
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). |
void |
multiply(Number n)
Multiply the data value by a specified number. |
void |
pow(Number n)
Raise the stored value to an exponent. |
void |
subtract(Number n)
Subtract a specified number from 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, 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 MobyDataFloat(Element element) throws IllegalArgumentException
IllegalArgumentException
- if the element is not a Float tagpublic MobyDataFloat(Element element, Registry registry) throws IllegalArgumentException
IllegalArgumentException
public MobyDataFloat(String articleName, Number n)
public MobyDataFloat(String articleName, Number n, Registry r)
public MobyDataFloat(Number n, Registry r)
public MobyDataFloat(Number n)
public MobyDataFloat(String articleName, double d)
public MobyDataFloat(String articleName, double d, Registry registry)
public MobyDataFloat(double d, Registry r)
public MobyDataFloat(double d)
public MobyDataFloat(String articleName, String stringNumber) throws NumberFormatException
NumberFormatException
- if the string does not represent a numberpublic MobyDataFloat(String articleName, String stringNumber, Registry registry) throws NumberFormatException
NumberFormatException
public MobyDataFloat(String stringNumber)
public MobyDataFloat(String stringNumber, Registry registry)
Method Detail |
---|
public MobyDataFloat clone()
MobyDataObject
clone
in class MobyDataObject
public void add(Number n)
public void subtract(Number n)
public void multiply(Number n)
public void divide(Number n)
public void divide(Number n, int mode)
public void pow(Number n)
public Object getObject()
MobyDataObject
getObject
in interface MobyDataInstance
getObject
in class MobyDataObject
public double doubleValue()
public String getValue()
MobyDataObject
getValue
in class MobyDataObject
public int compareTo(Object object)
compareTo
in interface Comparable
compareTo
in class MobyDataObject
public boolean equals(Object object)
equals
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 |