com.ibm.commerce.price.utils
Class UnitAmountDataBeanImpl

java.lang.Object
  |
  +--com.ibm.commerce.price.utils.UnitAmountDataBeanImpl
Direct Known Subclasses:
MonetaryAmountDataBean, QuantityAmountDataBeanImpl

public class UnitAmountDataBeanImpl
extends java.lang.Object

Monetary amount data bean service class.


Constructor Summary
protected UnitAmountDataBeanImpl()
          UnitAmountDataBeanImpl default constructor.
protected UnitAmountDataBeanImpl(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLangId)
          UnitAmountDataBeanImpl constructor.
 
Method Summary
protected  com.ibm.commerce.price.utils.FormattedUnitAmount formatAmount(UnitAmount anAmount)
          Format the amount.
 java.lang.String getCustomizedString()
          Get the customized string from the format table.
 java.lang.String getDescription()
          Get the description of the specified unit.
 java.lang.Integer getLangId()
          Get the language Id used to decide how to format the unit amounts.
 java.lang.String getNumberUsage()
          Get the number usage that was used to format the amount.
protected  UnitAmount getPrimaryAmount()
          Get the primary amount (round customized).
protected  com.ibm.commerce.price.utils.FormattedUnitAmount getPrimaryFormattedAmount()
          Get the formatted primary amount.
 StoreAccessBean getStoreAccessBean()
          Get the store access bean.
 java.lang.String getSymbol()
          Get the unit symbol information from the format table.
protected  void roundAmount(UnitAmount anAmount)
          Round the amount.
 void setLangId(java.lang.Integer newLangId)
          Set the language Id to use for the formatting.
 void setNumberUsage(java.lang.String newNumberUsage)
          (Optional) Set the number usage for the formatting.
protected  void setPrimaryAmount(UnitAmount newPrimaryAmount)
          Set the primary amount.
 void setStoreAccessBean(StoreAccessBean newStoreAccessBean)
          Set the store access bean to use for formatting.
protected  void setUnitManager(UnitManager newUnitManager)
          Set the unit manager that is to be used to retrieve important values.
 java.lang.String toString()
          Returns a String that represents the value of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnitAmountDataBeanImpl

protected UnitAmountDataBeanImpl()
UnitAmountDataBeanImpl default constructor.

UnitAmountDataBeanImpl

protected UnitAmountDataBeanImpl(UnitAmount aUnitAmount,
                                 StoreAccessBean aStoreAccessBean,
                                 java.lang.Integer aLangId)
UnitAmountDataBeanImpl constructor.
Parameters:
aUnitAmount - a unit amount.
aStoreAccessBean - the store under which the formatting is to occur.
aLangId - the language Id under which the formatting is to occur.
Method Detail

formatAmount

protected com.ibm.commerce.price.utils.FormattedUnitAmount formatAmount(UnitAmount anAmount)
                                                                 throws ECSystemException
Format the amount.
Parameters:
anAmount - The unit amount to format.
Returns:
A formatted unit amount.

getCustomizedString

public java.lang.String getCustomizedString()
                                     throws ECSystemException
Get the customized string from the format table.
Returns:
the customized string from the format table.

getDescription

public java.lang.String getDescription()
                                throws ECSystemException
Get the description of the specified unit.
Returns:
the unit description.

getLangId

public java.lang.Integer getLangId()
Get the language Id used to decide how to format the unit amounts.
Returns:
the language Id.

getNumberUsage

public java.lang.String getNumberUsage()
Get the number usage that was used to format the amount.
Returns:
The number usage.

getPrimaryAmount

protected UnitAmount getPrimaryAmount()
                               throws ECSystemException
Get the primary amount (round customized).
Returns:
com.ibm.commerce.price.utils.MonetaryAmount

getPrimaryFormattedAmount

protected com.ibm.commerce.price.utils.FormattedUnitAmount getPrimaryFormattedAmount()
                                                                              throws ECException
Get the formatted primary amount.
Returns:
a formatted unit amount

getStoreAccessBean

public StoreAccessBean getStoreAccessBean()
Get the store access bean.
Returns:
com.ibm.commerce.common.objects.StoreAccessBean

getSymbol

public java.lang.String getSymbol()
                           throws ECSystemException
Get the unit symbol information from the format table.
Returns:
the unit symbol.

roundAmount

protected void roundAmount(UnitAmount anAmount)
                    throws ECSystemException
Round the amount.
Parameters:
anAmount - com.ibm.commerce.price.utils.MonetaryAmount

setLangId

public void setLangId(java.lang.Integer newLangId)
Set the language Id to use for the formatting.
Parameters:
newLangId - language Id.

setNumberUsage

public void setNumberUsage(java.lang.String newNumberUsage)
(Optional) Set the number usage for the formatting. If not set, the default number usage will be used.
Parameters:
newNumberUsage - The number usage code.

setPrimaryAmount

protected void setPrimaryAmount(UnitAmount newPrimaryAmount)
Set the primary amount.
Parameters:
newPrimaryAmount - the primary unit amount.

setStoreAccessBean

public void setStoreAccessBean(StoreAccessBean newStoreAccessBean)
Set the store access bean to use for formatting.
Parameters:
newStoreAccessBean - store access bean.

setUnitManager

protected void setUnitManager(UnitManager newUnitManager)
Set the unit manager that is to be used to retrieve important values.
Parameters:
newUnitManager - The unit manager.

toString

public java.lang.String toString()
Returns a String that represents the value of this object. The string includes the formatted unit amount
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the unit amount.