org.salespointframework.core.data
Class NumberValue

java.lang.Object
  extended by org.salespointframework.core.data.NumberValue
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<Value>, Value
Direct Known Subclasses:
DoubleValue, IntegerValue

public abstract class NumberValue
extends java.lang.Object
implements Value

Values that operate on numbers.

All the operations are implemented as you would expect, the implementation is given in concrete subclasses.

Since:
v2.0
Version:
2.0 19/08/1999
Author:
Steffen Zschaler

Field Summary
private  java.lang.Number m_nbValue
          The actual value.
 
Constructor Summary
NumberValue(java.lang.Number nbValue)
          Create a new NumberValue.
 
Method Summary
abstract  java.lang.Object clone()
          Clone this value.
 java.lang.Number getValue()
          Get the actual value of the object.
 boolean isAddZero()
          Check whether this is the zero element with respect to addition.
 boolean isGreaterZero()
           
 boolean isLessZero()
           
 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.
 void setValue(java.lang.Number nbValue)
          Set the actual value of the object.
 java.lang.String toString()
          Return a String representation of the object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.salespointframework.core.data.interfaces.Value
add, addAccumulating, divide, divideAccumulating, multiply, multiply, multiply, multiply, multiply, multiplyAccumulating, multiplyAccumulating, multiplyAccumulating, multiplyAccumulating, multiplyAccumulating, subtract, subtractAccumulating
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

m_nbValue

private java.lang.Number m_nbValue
The actual value.

Constructor Detail

NumberValue

public NumberValue(java.lang.Number nbValue)
Create a new NumberValue.

Parameters:
nbValue - the actual initial value.
Method Detail

setValue

public void setValue(java.lang.Number nbValue)
Set the actual value of the object.

Parameters:
nbValue - the new actual value.

getValue

public java.lang.Number getValue()
Get the actual value of the object.


isAddZero

public boolean isAddZero()
Description copied from interface: Value
Check whether this is the zero element with respect to addition.

Specified by:
isAddZero in interface Value
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))).

isGreaterZero

public boolean isGreaterZero()

isLessZero

public boolean isLessZero()

isMulZero

public boolean isMulZero()
Description copied from interface: Value
Check whether this is the zero element with respect to multiplication.

Specified by:
isMulZero in interface Value
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))).

isMulOne

public boolean isMulOne()
Description copied from interface: Value
Check whether this is the one element with respect to multiplication.

Specified by:
isMulOne in interface Value
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))).

clone

public abstract java.lang.Object clone()
Description copied from interface: Value
Clone this value.

Specified by:
clone in interface Value
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Return a String representation of the object.

Overrides:
toString in class java.lang.Object