|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.object.value.AbstractNakedValue
org.nakedobjects.object.value.Magnitude
org.nakedobjects.object.value.Money
Value object representing a monetary value including a currency type.
This object does support value listeners
| Constructor Summary | |
Money()
Create a Money with zero value. |
|
Money(double amount)
|
|
Money(Money money)
Create a Money object with the same value as the specified object. |
|
| Method Summary | |
void |
add(Money money)
Add the specified money to this money. |
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 |
divideBy(double operand)
Divides this value by the specified amount. |
double |
doubleValue()
|
float |
floatValue()
Returns this value as an float. |
org.apache.log4j.Logger |
getLogger()
subclasses can override (didn't make abstract so that existing subclasses won't break) |
java.lang.String |
getObjectHelpText()
Returns a textual desctiption of the object - its contents and possible uses. |
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)
|
boolean |
isNegative()
Returns true if this value is less than zero. |
long |
longValue()
Returns this value as an long. |
void |
multiplyBy(double operand)
Multiply this value by the specified amount. |
void |
parse(java.lang.String text)
Takes a user entry string which is parsed to set up the object. |
void |
readExternal(java.io.ObjectInput in)
|
void |
reset()
Reset this money so it contains 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 amount)
Set this value to have the specified values. |
void |
setValue(Money value)
Set this value to be the same as the specified value. |
short |
shortValue()
Returns this value as an short. |
void |
subtract(Money money)
Subtract the specified amount from this value. |
Title |
title()
Returns a Title object describing the object. |
void |
writeExternal(java.io.ObjectOutput out)
|
| 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, 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 |
public Money()
public Money(Money money)
public Money(double amount)
| Method Detail |
public void add(Money money)
public void clear()
NakedValueisEmpty returns true.
public void copyObject(Naked object)
object - the object to copy the data frompublic void divideBy(double operand)
public double doubleValue()
public float floatValue()
public java.lang.String getObjectHelpText()
Naked
getObjectHelpText in interface NakedgetObjectHelpText in class AbstractNakedValuepublic int intValue()
public boolean isEmpty()
Naked
public boolean isEqualTo(Magnitude magnitude)
isEqualTo in class Magnitudepublic boolean isLessThan(Magnitude magnitude)
isLessThan in class Magnitudepublic boolean isNegative()
public long longValue()
public void multiplyBy(double operand)
public void parse(java.lang.String text)
throws ValueParseException
NakedValue
ValueParseExceptionNakedValue.restoreString(String)
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundExceptionpublic void reset()
NakedValue.reset()public void setValue(double amount)
public void setValue(Money value)
public short shortValue()
public void subtract(Money money)
public Title title()
Naked
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
java.io.IOExceptionpublic void restoreString(java.lang.String data)
NakedValue
data - NakedValue.parse(String)public java.lang.String saveString()
NakedValue
public org.apache.log4j.Logger getLogger()
AbstractNakedValue
getLogger in class AbstractNakedValue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||