UnitPrice Interface
- public interface UnitPrice
extends Belonging
Combines a unit and a price to provide a mechanism for recording pricing and pricing strategies. It also provides features for converting prices between units.
Attribute: price
The price component of the UnitPrice.
- Containment: By Value
- Multiplicity: 1:1
Attribute: unit
The unit component of the UnitPrice.
- Containment: By Value
- Multiplicity: 1:1
Related Topics
UnitPriceHome
UnitPriceImpl
-
All Known Implementing Classes
-
UnitPriceImpl
-
All Superinterfaces
-
Belonging
, BusinessSmartComponent
, Cloneable
, Comparable
, Serializable
public UnitPrice |
-
convert (Unit newUnit)
- Return a new UnitPrice that maintains the Price/Unit ratio with the newly specified unit.
|
public void |
-
convertInPlace (Unit newUnit)
- Translate the UnitPrice into the new Units maintaining the Price/Unit ratio.
|
public Price |
-
getPrice ()
- Get the value of price
|
public Unit |
-
getUnit ()
- Get the value of unit
|
public void |
-
setPrice (Price price)
- Set the value of price
|
public void |
-
setUnit (Unit unit)
- Set the value of unit
|
convert(Unit) Method
public UnitPrice
convert(Unit
newUnit)
throws InvalidUnitException
Return a new UnitPrice that maintains the Price/Unit ratio with the newly specified unit.
Exceptions
-
InvalidUnitException
convertInPlace(Unit) Method
public void convertInPlace(Unit
newUnit)
throws InvalidUnitException
Translate the UnitPrice into the new Units maintaining the Price/Unit ratio.
Exceptions
-
InvalidUnitException
getPrice() Method
public Price
getPrice()
Get the value of price
Returns
- price.
getUnit() Method
public Unit
getUnit()
Get the value of unit
Returns
- unit.
setPrice(Price) Method
public void setPrice(Price
price)
Set the value of price
Parameters
-
price
- price to be added
setUnit(Unit) Method
public void setUnit(Unit
unit)
Set the value of unit
Parameters
-
unit
- unit to be added