bea Systems, Inc.

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

Field Summary
 Price price
           price [UnitPrice] <*>------> [theory.smart.axiom.units.Price]
 Unit unit
           unit [UnitPrice] <*>------> [theory.smart.axiom.units.Unit]
 
Fields inherited from class theory.smart.foundation.BelongingImpl
isDirty
 
Constructor Summary
UnitPriceImpl()
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 UnitPrice convert(Unit newUnit)
          Return a new UnitPrice that maintains the Price/Unit ratio with the newly specified unit.
 void convertInPlace(Unit newUnit)
          Translate the UnitPrice into the new Units maintaining the Price/Unit ratio.
 Price getPrice()
          Get the value of price
 Unit getUnit()
          Get the value of unit
 void setPrice(Price price)
          Set the value of price
 void setUnit(Unit unit)
          Set the value of unit
 Belonging value()
           
 
Methods inherited from class theory.smart.foundation.BelongingImpl
equals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

price

public Price price
                  price
 [UnitPrice] <*>------> [theory.smart.axiom.units.Price] 

 

unit

public Unit unit
                  unit
 [UnitPrice] <*>------> [theory.smart.axiom.units.Unit] 

 
Constructor Detail

UnitPriceImpl

public UnitPriceImpl()
Method Detail

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

bea Systems, Inc.

© Copyright 2000 bea Systems, Inc. All rights reserved.