SalesPoint Framework v3.0

data
Class NumberValue

java.lang.Object
  |
  +--data.NumberValue
Direct Known Subclasses:
DoubleValue, IntegerValue

public abstract class NumberValue
extends 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
See Also:
Serialized Form

Constructor Summary
NumberValue(Number nbValue)
          Create a new NumberValue.
 
Method Summary
abstract  Object clone()
           
 Number getValue()
          Get the actual value of the object.
 boolean isAddZero()
           
 boolean isMulOne()
           
 boolean isMulZero()
           
 void setValue(Number nbValue)
          Set the actual value of the object.
 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
 

Constructor Detail

NumberValue

public NumberValue(Number nbValue)
Create a new NumberValue.
Parameters:
nbValue - the actual initial value.
Method Detail

setValue

public void setValue(Number nbValue)
Set the actual value of the object.
Override:
Sometimes.
Override if you want to impose restrictions on the class of the actual value.
Parameters:
nbValue - the new actual value.

getValue

public Number getValue()
Get the actual value of the object.
Override:
Never.

isAddZero

public boolean isAddZero()
Override:
Sometimes.
The default implementation returns
 (getValue().longValue() == 0)
 
Specified by:
isAddZero in interface Value

isMulZero

public boolean isMulZero()
Override:
Sometimes.
The default implementation returns
 isAddZero()
 
Specified by:
isMulZero in interface Value

isMulOne

public boolean isMulOne()
Override:
Sometimes.
The default implementation returns
 (getValue().longValue() == 1)
 
Specified by:
isMulOne in interface Value

clone

public abstract Object clone()
Override:
Always.
Specified by:
clone in interface Value
Overrides:
clone in class Object

toString

public String toString()
Return a String representation of the object.
Override:
Sometimes.
The default implementation returns
 getValue().toString()
 
Overrides:
toString in class Object

SalesPoint Framework v3.0