|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.salespointframework.core.data.NumberValue
org.salespointframework.core.data.DoubleValue
public class DoubleValue
A NumberValue that is based on a Double object.
All operations are implemented as one might expect.
| Constructor Summary | |
|---|---|
DoubleValue(double dlValue)
Create a new DoubleValue. |
|
DoubleValue(java.lang.Number nbValue)
Create a new DoubleValue. |
|
| Method Summary | |
|---|---|
Value |
add(Value v)
Add the given value to this one, and return the result. |
void |
addAccumulating(Value v)
Add the given value to this one, changing this value. |
java.lang.Object |
clone()
Clone this value. |
int |
compareTo(Value v)
Compare this value to the given one. |
Value |
divide(Value v)
Divide this value by the given one, and return the result. |
void |
divideAccumulating(Value v)
Divide this value by the given one, changing this value. |
boolean |
isAddZero()
Correctly checks getValue().doubleValue(). |
boolean |
isMulOne()
Correctly checks getValue().doubleValue(). |
Value |
multiply(double dl)
Multiply this value by the given 'scalar', and return the result. |
Value |
multiply(float fl)
Multiply this value by the given 'scalar', and return the result. |
Value |
multiply(int n)
Multiply this value by the given 'scalar', and return the result. |
Value |
multiply(long l)
Multiply this value by the given 'scalar', and return the result. |
Value |
multiply(Value v)
Multiply this value by the given one, and return the result. |
void |
multiplyAccumulating(double dl)
Multiply this value by the given 'scalar', changing this value. |
void |
multiplyAccumulating(float fl)
Multiply this value by the given 'scalar', changing this value. |
void |
multiplyAccumulating(int n)
Multiply this value by the given 'scalar', changing this value. |
void |
multiplyAccumulating(long l)
Multiply this value by the given 'scalar', changing this value. |
void |
multiplyAccumulating(Value v)
Multiply the given value by this one, changing this value. |
void |
setValue(java.lang.Number nbValue)
Convert the given value to a Double before setting the actual value of the object. |
Value |
subtract(Value v)
Subtract the given value from this one, and return the result. |
void |
subtractAccumulating(Value v)
Subtract the given value from this one, changing this value. |
| Methods inherited from class org.salespointframework.core.data.NumberValue |
|---|
getValue, isGreaterZero, isLessZero, isMulZero, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DoubleValue(java.lang.Number nbValue)
nbValue - the initial value of the object. Will be converted to a Double.public DoubleValue(double dlValue)
dlValue - the initial value of the object.| Method Detail |
|---|
public void setValue(java.lang.Number nbValue)
Double before setting the actual value of the object.
setValue in class NumberValuenbValue - the new actual value.public void addAccumulating(Value v)
Value
v - the value to be added.public void subtractAccumulating(Value v)
Value
v - the value to be subtracted.public void multiplyAccumulating(Value v)
Value
v - the value to be multplied by.public void multiplyAccumulating(double dl)
Value
dl - the value by which to multiply.public void multiplyAccumulating(float fl)
Value
fl - the value by which to multiply.public void multiplyAccumulating(long l)
Value
l - the value by which to multiply.public void multiplyAccumulating(int n)
Value
n - the value by which to multiply.public void divideAccumulating(Value v)
Value
v - the value by which to divide.public Value add(Value v)
Value
v - the value to be added.public Value subtract(Value v)
Value
v - the value to be subtracted.public Value multiply(Value v)
Value
v - the value by which to multiply.public Value multiply(double dl)
Value
dl - the 'scalar' by which to multiply.public Value multiply(float fl)
Value
fl - the 'scalar' by which to multiply.public Value multiply(long l)
Value
l - the 'scalar' by which to multiply.public Value multiply(int n)
Value
n - the 'scalar' by which to multiply.public Value divide(Value v)
Value
v - the value by which to divide.public int compareTo(Value v)
java.lang.ClassCastException - if the given object cannot be casted into a NumberValue.public java.lang.Object clone()
Value
clone in interface Valueclone in class NumberValuepublic boolean isAddZero()
getValue().doubleValue().
isAddZero in interface ValueisAddZero in class NumberValuev:
(v.getClass() == this.getClass()) -> ((v.add (this).equals (v)) && (this.add (v).equals (v))).public boolean isMulOne()
getValue().doubleValue().
isMulOne in interface ValueisMulOne in class NumberValuev:
(v.getClass() == this.getClass()) -> ((v.multiply (this).equals (v)) && (this.multiply (v).equals (v))).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||