com.ibm.commerce.price.utils
Class QuantityAmount
java.lang.Object
|
+--com.ibm.commerce.price.utils.UnitAmount
|
+--com.ibm.commerce.price.utils.QuantityAmount
- public class QuantityAmount
- extends UnitAmount
A quantity amount.
Constructor Summary |
QuantityAmount(double aValue,
java.lang.String aQuantityUnit)
Constructs a quantity amount from a numeric value and quantity unit. |
Method Summary |
protected UnitAmount |
createNewUnitAmount(java.lang.Object aValue,
java.lang.String aUnit)
Create a new quantity amount from the parameters. |
java.lang.String |
getQuantityUnit()
Get the unit of the quantity amount. |
double |
getValue()
Get the numeric value of the quantity amount. |
void |
setValue(double aValue)
Set the numeric value of the quantity amount. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
QuantityAmount
public QuantityAmount(double aValue,
java.lang.String aQuantityUnit)
- Constructs a quantity amount from a numeric value and quantity unit.
- Parameters:
aValue
- the numeric value of the quantity amount.aQuantityUnit
- the quantity unit.
createNewUnitAmount
protected UnitAmount createNewUnitAmount(java.lang.Object aValue,
java.lang.String aUnit)
- Create a new quantity amount from the parameters.
- Overrides:
createNewUnitAmount
in class UnitAmount
- Parameters:
aValue
- The value of the amount.aUnit
- The quantity unit of the amount.- Returns:
- The new quantity amount.
getQuantityUnit
public java.lang.String getQuantityUnit()
- Get the unit of the quantity amount.
- Returns:
- the quantity unit.
getValue
public double getValue()
- Get the numeric value of the quantity amount.
- Returns:
- the value.
setValue
public void setValue(double aValue)
- Set the numeric value of the quantity amount.
- Parameters:
aValue
- new value.