SalesPoint v3.3 API

data
Interface Value

All Superinterfaces:
Cloneable, Comparable<Value>, Serializable
All Known Implementing Classes:
DoubleValue, IntegerValue, NumberValue, QuoteValue

public interface Value
extends Cloneable, Comparable<Value>, Serializable

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.

Since:
v2.0
Author:
Steffen Zschaler

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

addAccumulating

void addAccumulating(Value v)
Add the given value to this one, changing this value.

Parameters:
v - the value to be added.
Override:
Always

subtractAccumulating

void subtractAccumulating(Value v)
Subtract the given value from this one, changing this value.

Parameters:
v - the value to be subtracted.
Override:
Always

multiplyAccumulating

void multiplyAccumulating(Value v)
Multiply the given value by this one, changing this value.

Parameters:
v - the value to be multplied by.
Override:
Always

multiplyAccumulating

void multiplyAccumulating(double dl)
Multiply this value by the given 'scalar', changing this value.

Parameters:
dl - the value by which to multiply.
Override:
Always

multiplyAccumulating

void multiplyAccumulating(float fl)
Multiply this value by the given 'scalar', changing this value.

Parameters:
fl - the value by which to multiply.
Override:
Always

multiplyAccumulating

void multiplyAccumulating(long l)
Multiply this value by the given 'scalar', changing this value.

Parameters:
l - the value by which to multiply.
Override:
Always

multiplyAccumulating

void multiplyAccumulating(int n)
Multiply this value by the given 'scalar', changing this value.

Parameters:
n - the value by which to multiply.
Override:
Always

divideAccumulating

void divideAccumulating(Value v)
Divide this value by the given one, changing this value.

Parameters:
v - the value by which to divide.
Override:
Always

add

Value add(Value v)
Add the given value to this one, and return the result.

Parameters:
v - the value to be added.
Override:
Always

subtract

Value subtract(Value v)
Subtract the given value from this one, and return the result.

Parameters:
v - the value to be subtracted.
Override:
Always

multiply

Value multiply(Value v)
Multiply this value by the given one, and return the result.

Parameters:
v - the value by which to multiply.
Override:
Always

multiply

Value multiply(double dl)
Multiply this value by the given 'scalar', and return the result.

Parameters:
dl - the 'scalar' by which to multiply.
Override:
Always

multiply

Value multiply(float fl)
Multiply this value by the given 'scalar', and return the result.

Parameters:
fl - the 'scalar' by which to multiply.
Override:
Always

multiply

Value multiply(long l)
Multiply this value by the given 'scalar', and return the result.

Parameters:
l - the 'scalar' by which to multiply.
Override:
Always

multiply

Value multiply(int n)
Multiply this value by the given 'scalar', and return the result.

Parameters:
n - the 'scalar' by which to multiply.
Override:
Always

divide

Value divide(Value v)
Divide this value by the given one, and return the result.

Parameters:
v - the value by which to divide.
Override:
Always

isAddZero

boolean isAddZero()
Check whether this is the zero element with respect to addition.

Returns:
true if this is the zero element with respect to addition, i.e. if for any value v: (v.getClass() == this.getClass()) -> ((v.add (this).equals (v)) && (this.add (v).equals (v))).
Override:
Always

isMulZero

boolean isMulZero()
Check whether this is the zero element with respect to multiplication.

Returns:
true if this is the zero element with respect to multiplication, i.e. if for any value v: (v.getClass() == this.getClass()) -> ((v.multiply (this).equals (this)) && (this.multiply (v).equals (this))).
Override:
Always

isMulOne

boolean isMulOne()
Check whether this is the one element with respect to multiplication.

Returns:
true if this is the one element with respect to multiplication, i.e. if for any value v: (v.getClass() == this.getClass()) -> ((v.multiply (this).equals (v)) && (this.multiply (v).equals (v))).
Override:
Always

clone

Object clone()
Clone this value.

Override:
Always

SalesPoint v3.3 API