com.ibm.commerce.price.utils
Class UnitAmount

java.lang.Object
  com.ibm.commerce.price.utils.UnitAmount
Direct Known Subclasses:
MonetaryAmount, QuantityAmount

public abstract class UnitAmount
extends java.lang.Object

Abstract base class that represents a unit amount.


Constructor Summary
protected UnitAmount(java.lang.Object aValue, java.lang.String aUnit)
Constructs a unit amount from a value and unit.
Method Summary
protected abstract UnitAmount createNewUnitAmount(java.lang.Object aValue, java.lang.String aUnit)
Create a new unit amount from the parameters.
protected java.lang.String getUnit()
Get the units of the unit amount.
protected java.lang.Object getValueI()
Get the value of the unit amount.
protected void setUnit(java.lang.String newUnit)
Set the units.
protected void setValue(java.lang.Object aValue)
Set the value of the unit amount.
java.lang.String toString()
Convert to a string.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UnitAmount

protected UnitAmount(java.lang.Object aValue,
                     java.lang.String aUnit)
Constructs a unit amount from a value and unit.
Parameters:
aValue - the value of the amount.
aUnit - the unit of the amount.
Method Detail

createNewUnitAmount

protected abstract UnitAmount createNewUnitAmount(java.lang.Object aValue,
                                                  java.lang.String aUnit)
Create a new unit amount from the parameters.
Parameters:
aValue - The value of the amount.
aUnit - The unit of the amount.
Returns:
The new unit amount.

getUnit

protected java.lang.String getUnit()
Get the units of the unit amount.
Returns:
the units.

getValueI

protected java.lang.Object getValueI()
Get the value of the unit amount.
Returns:
the value.

setUnit

protected void setUnit(java.lang.String newUnit)
Set the units.
Parameters:
newUnit - The units.

setValue

protected void setValue(java.lang.Object aValue)
Set the value of the unit amount.
Parameters:
aValue - the new value for the unit amount.

toString

public java.lang.String toString()
Convert to a string.
Returns:
java.lang.String

Feedback