theory.smart.axiom.units
Class UnitPriceImpl
java.lang.Object
|
+--theory.smart.foundation.BelongingImpl
|
+--theory.smart.axiom.units.UnitPriceImpl
- public class UnitPriceImpl
- extends BelongingImpl
- implements UnitPrice
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.
- See Also:
UnitPrice
,
UnitPriceHome
, Serialized Form
Methods inherited from class java.lang.Object |
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
price
public Price price
price
[UnitPrice] <*>------> [theory.smart.axiom.units.Price
]
unit
public Unit unit
unit
[UnitPrice] <*>------> [theory.smart.axiom.units.Unit
]
UnitPriceImpl
public UnitPriceImpl()
getPrice
public Price getPrice()
- Get the value of price
- Specified by:
- getPrice in interface UnitPrice
- Returns:
- price.
setPrice
public void setPrice(Price price)
- Set the value of price
- Specified by:
- setPrice in interface UnitPrice
- Parameters:
price
- price to be added
getUnit
public Unit getUnit()
- Get the value of unit
- Specified by:
- getUnit in interface UnitPrice
- Returns:
- unit.
setUnit
public void setUnit(Unit unit)
- Set the value of unit
- Specified by:
- setUnit in interface UnitPrice
- Parameters:
unit
- unit to be added
value
public Belonging value()
compareTo
public int compareTo(java.lang.Object o)
- Overrides:
- compareTo in class BelongingImpl
convert
public UnitPrice convert(Unit newUnit)
- Return a new UnitPrice that maintains the Price/Unit ratio with the newly specified unit.
- Specified by:
- convert in interface UnitPrice
convertInPlace
public void convertInPlace(Unit newUnit)
- Translate the UnitPrice into the new Units maintaining the Price/Unit ratio.
- Specified by:
- convertInPlace in interface UnitPrice
Copyright © 2000 BEA Systems, Inc. All Rights Reserved