org.nakedobjects.object.value
Class FloatingPointNumber

java.lang.Object
  extended byorg.nakedobjects.object.value.AbstractNakedValue
      extended byorg.nakedobjects.object.value.Magnitude
          extended byorg.nakedobjects.object.value.FloatingPointNumber
All Implemented Interfaces:
Naked, NakedValue, java.io.Serializable

public class FloatingPointNumber
extends Magnitude

NOTE: this class currently does not support about listeners.

See Also:
Serialized Form

Constructor Summary
FloatingPointNumber()
           
FloatingPointNumber(double value)
           
FloatingPointNumber(FloatingPointNumber value)
           
FloatingPointNumber(java.lang.String text)
          Deprecated.  
 
Method Summary
 void add(double value)
           
 void add(FloatingPointNumber number)
           
 void clear()
          Clears the value so that it is empty, i.e.
 void copyObject(Naked object)
          Copies the specified object's contained data to this instance.
 void divide(double value)
           
 void divide(FloatingPointNumber number)
           
 double doubleValue()
          Returns this value as an double.
 float floatValue()
          Returns this value as an float.
 java.lang.String getObjectHelpText()
          Returns a textual desctiption of the object - its contents and possible uses.
 double getValue()
          Deprecated. replaced by doubleValue
 int intValue()
          Returns this value as an int.
 boolean isEmpty()
          Returns true if the object contains no data, eg when new
 boolean isEqualTo(Magnitude magnitude)
           
 boolean isLessThan(Magnitude magnitude)
           
 long longValue()
          Returns this value as an long.
 void multiply(double value)
           
 void multiply(FloatingPointNumber number)
           
 void parse(java.lang.String text)
          Takes a user entry string which is parsed to set up the object.
 void reset()
          Reset this floating point number so it contains 0.0.
 void restoreString(java.lang.String data)
          Takes a storage string and uses it reinstate this value object to its previous state/
 java.lang.String saveString()
          Returns a basic string representation of this value for storage purposes.
 void setValue(double value)
           
 void setValue(FloatingPointNumber value)
           
 short shortValue()
          Returns this value as an short.
 void subtract(double value)
           
 void subtract(FloatingPointNumber number)
           
 Title title()
          Returns a Title object describing the object.
 
Methods inherited from class org.nakedobjects.object.value.Magnitude
isBetween, isGreaterThan, isGreaterThanOrEqualTo, isLessThanOrEqualTo, isSameAs, max, min
 
Methods inherited from class org.nakedobjects.object.value.AbstractNakedValue
about, addNakedValueListener, checkCanOperate, contextualTitle, deepCopy, dumpObject, fireValueChanged, fireValueChanged, getClassName, getFullClassName, getLogger, isNull, isValid, nakedValueListeners, removeNakedValueListener, setAbout, setNull, setValidity, summary, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FloatingPointNumber

public FloatingPointNumber()

FloatingPointNumber

public FloatingPointNumber(double value)

FloatingPointNumber

public FloatingPointNumber(java.lang.String text)
Deprecated.  


FloatingPointNumber

public FloatingPointNumber(FloatingPointNumber value)
Method Detail

add

public void add(double value)

add

public void add(FloatingPointNumber number)

clear

public void clear()
Description copied from interface: NakedValue
Clears the value so that it is empty, i.e. isEmpty returns true.


copyObject

public void copyObject(Naked object)
Copies the specified object's contained data to this instance. param object the object to copy the data from


divide

public void divide(double value)

divide

public void divide(FloatingPointNumber number)

doubleValue

public double doubleValue()
Returns this value as an double.


floatValue

public float floatValue()
Returns this value as an float.


getObjectHelpText

public java.lang.String getObjectHelpText()
Description copied from interface: Naked
Returns a textual desctiption of the object - its contents and possible uses.

Specified by:
getObjectHelpText in interface Naked
Overrides:
getObjectHelpText in class AbstractNakedValue

getValue

public double getValue()
Deprecated. replaced by doubleValue

See Also:
doubleValue()

intValue

public int intValue()
Returns this value as an int.


isEmpty

public boolean isEmpty()
Description copied from interface: Naked
Returns true if the object contains no data, eg when new


isEqualTo

public boolean isEqualTo(Magnitude magnitude)
Specified by:
isEqualTo in class Magnitude

isLessThan

public boolean isLessThan(Magnitude magnitude)
Specified by:
isLessThan in class Magnitude

longValue

public long longValue()
Returns this value as an long.


multiply

public void multiply(double value)

multiply

public void multiply(FloatingPointNumber number)

parse

public void parse(java.lang.String text)
           throws ValueParseException
Description copied from interface: NakedValue
Takes a user entry string which is parsed to set up the object. This needs to accomodate punctuation and adornments such as currency signs.

Throws:
ValueParseException
See Also:
NakedValue.restoreString(String)

reset

public void reset()
Reset this floating point number so it contains 0.0.

See Also:
NakedValue.reset()

setValue

public void setValue(double value)

setValue

public void setValue(FloatingPointNumber value)

shortValue

public short shortValue()
Returns this value as an short.


subtract

public void subtract(double value)

subtract

public void subtract(FloatingPointNumber number)

title

public Title title()
Description copied from interface: Naked
Returns a Title object describing the object.


restoreString

public void restoreString(java.lang.String data)
Description copied from interface: NakedValue
Takes a storage string and uses it reinstate this value object to its previous state/

Parameters:
data -
See Also:
NakedValue.parse(String)

saveString

public java.lang.String saveString()
Description copied from interface: NakedValue
Returns a basic string representation of this value for storage purposes.