|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Value
An objectified value.
Values are objects that understand the four basic operations add
, subtract
,
multiply
and divide
. Additionally, they have an operation for multiplication with
'scalars', i.e. simple type numeric values. Values are commutative monoids with respect to addition and
multiplication.
An ordering relation is defined on the values, but it is up to the concrete type of value, whether this ordering is a half ordering relation.
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. |
Object |
clone()
Clone this value. |
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()
Check whether this is the zero element with respect to addition. |
boolean |
isMulOne()
Check whether this is the one element with respect to multiplication. |
boolean |
isMulZero()
Check whether this is the zero element with respect to multiplication. |
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. |
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 interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
void addAccumulating(Value v)
v
- the value to be added.void subtractAccumulating(Value v)
v
- the value to be subtracted.void multiplyAccumulating(Value v)
v
- the value to be multplied by.void multiplyAccumulating(double dl)
dl
- the value by which to multiply.void multiplyAccumulating(float fl)
fl
- the value by which to multiply.void multiplyAccumulating(long l)
l
- the value by which to multiply.void multiplyAccumulating(int n)
n
- the value by which to multiply.void divideAccumulating(Value v)
v
- the value by which to divide.Value add(Value v)
v
- the value to be added.Value subtract(Value v)
v
- the value to be subtracted.Value multiply(Value v)
v
- the value by which to multiply.Value multiply(double dl)
dl
- the 'scalar' by which to multiply.Value multiply(float fl)
fl
- the 'scalar' by which to multiply.Value multiply(long l)
l
- the 'scalar' by which to multiply.Value multiply(int n)
n
- the 'scalar' by which to multiply.Value divide(Value v)
v
- the value by which to divide.boolean isAddZero()
v
:
(v.getClass() == this.getClass()) -> ((v.add (this).equals (v)) && (this.add (v).equals (v)))
.boolean isMulZero()
v
:
(v.getClass() == this.getClass()) -> ((v.multiply (this).equals (this)) && (this.multiply (v).equals (this)))
.boolean isMulOne()
v
:
(v.getClass() == this.getClass()) -> ((v.multiply (this).equals (v)) && (this.multiply (v).equals (v)))
.Object clone()
|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |