|
||||||||||
| 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.WholeNumber
Value object to represent an integral number.
This object does support value listeners.
| Constructor Summary | |
WholeNumber()
Creates a WholeNumber with zero value; |
|
WholeNumber(int whole)
Creates a WholeNumber with the specified value; |
|
WholeNumber(java.lang.String text)
Deprecated. |
|
WholeNumber(WholeNumber wholeNumber)
Creates a WholeNumber with the same value as the specified object; |
|
| Method Summary | |
void |
abs()
if non-null, makes the value positive. |
void |
add(int whole)
Adds the specified amount to this value. |
void |
add(WholeNumber whole)
Adds the specified value to this value. |
void |
clear()
Clears the value so that it is empty, i.e. |
int |
compareTo(int value)
returns the difference between this obect and the value: 0 means they are equal. |
void |
copyObject(Naked object)
Copies the content of the specified object into this object. |
void |
divide(double whole)
Divides this value by the specified amount. |
void |
divide(int whole)
Divides this value by the specified amount. |
void |
divide(WholeNumber number)
Divides this value by the specified amount. |
double |
doubleValue()
Returns this value as an double. |
boolean |
equals(java.lang.Object object)
|
float |
floatValue()
Returns this value as an float. |
int |
getInt()
Deprecated. |
protected 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 number)
returns true if the number of this object has the same value as the specified number |
boolean |
isLessThan(Magnitude value)
Returns true if this value is less than the specified value. |
boolean |
isNegative()
Returns true if this value is less than 0. |
boolean |
isZero()
Returns true if this value is 0. |
long |
longValue()
Returns this value as an long. |
void |
multiply(int whole)
Multiply this value by the specified amount. |
void |
multiply(WholeNumber number)
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 |
reset()
Reset this whole number 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 |
set(int whole)
Sets this value to be the specified value. |
void |
set(WholeNumber value)
Deprecated. replaced by setValue |
void |
setInt(int whole)
Deprecated. replaced by setValue |
void |
setValue(int whole)
|
void |
setValue(WholeNumber value)
|
short |
shortValue()
Returns this value as an short. |
void |
subtract(int whole)
Substracts the specified amount from this value. |
void |
subtract(WholeNumber number)
Subtracts the specified amount from this value. |
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, isNull, isValid, nakedValueListeners, removeNakedValueListener, setAbout, setNull, setValidity, summary, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public WholeNumber()
public WholeNumber(int whole)
public WholeNumber(java.lang.String text)
public WholeNumber(WholeNumber wholeNumber)
| Method Detail |
public void add(int whole)
public void add(WholeNumber whole)
public void clear()
NakedValueisEmpty returns true.
public int compareTo(int value)
public void copyObject(Naked object)
Naked
public void divide(int whole)
public void divide(double whole)
public void divide(WholeNumber number)
public double doubleValue()
public boolean equals(java.lang.Object object)
public float floatValue()
public int getInt()
intValue()public java.lang.String getObjectHelpText()
Naked
getObjectHelpText in interface NakedgetObjectHelpText in class AbstractNakedValuepublic int intValue()
public boolean isEmpty()
Naked
public boolean isEqualTo(Magnitude number)
isEqualTo in class Magnitudepublic boolean isLessThan(Magnitude value)
isLessThan in class Magnitudepublic boolean isNegative()
public boolean isZero()
public long longValue()
public void multiply(int whole)
public void multiply(WholeNumber number)
public void parse(java.lang.String text)
throws ValueParseException
NakedValue
ValueParseExceptionNakedValue.restoreString(String)public void reset()
NakedValue.reset()public void set(int whole)
public void set(WholeNumber value)
public void setInt(int whole)
public void setValue(int whole)
public void setValue(WholeNumber value)
public short shortValue()
public void subtract(int whole)
public void subtract(WholeNumber number)
public void abs()
public Title title()
Naked
public void restoreString(java.lang.String data)
NakedValue
data - NakedValue.parse(String)public java.lang.String saveString()
NakedValue
protected 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 | |||||||||