com.ibm.commerce.price.beans
Class CategorizedMonetaryAmountsDataBean

java.lang.Object
  |
  +--com.ibm.commerce.price.utils.UnitAmountDataBeanImpl
        |
        +--com.ibm.commerce.price.utils.MonetaryAmountDataBean
              |
              +--com.ibm.commerce.price.beans.CategorizedMonetaryAmountsDataBean
All Implemented Interfaces:
CategorizedMonetaryAmountsInputDataBean, CategorizedMonetaryAmountsSmartDataBean

public class CategorizedMonetaryAmountsDataBean
extends MonetaryAmountDataBean
implements CategorizedMonetaryAmountsInputDataBean, CategorizedMonetaryAmountsSmartDataBean

This DataBean is a formatter bean for formatting multiple monetary amounts that are of different categories. One example that will use this formatter will be the taxation that can be composed of several tax categories (e.g. GST, PST).


Fields inherited from class com.ibm.commerce.price.utils.MonetaryAmountDataBean
iCounterValueListPrefix, iCounterValueListSeparator, iCounterValueListSuffix
 
Constructor Summary
CategorizedMonetaryAmountsDataBean()
          CategorizedMonetaryAmountFormatter constructor.
CategorizedMonetaryAmountsDataBean(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLangId, java.lang.String aCategoryName)
          CategorizedMonetaryAmountFormatter constructor.
CategorizedMonetaryAmountsDataBean(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLangId, java.lang.String aCategoryName, java.util.Hashtable aDescHash, java.util.Hashtable aAmountHash, java.util.Hashtable aAmountDBHash)
          CategorizedMonetaryAmountFormatter constructor.
 
Method Summary
 java.lang.String getACategorizedAmountWithName(java.lang.String aCategory)
          Return the monetary amount and name of a particular category.
 java.lang.String getACategorizedValueWithName(java.lang.String aCategory)
          Return the monetary value and name of a particular category.
 java.lang.String getAllCategorizedAmountsWithNames()
          Return all of the categorized monetary amounts and names.
 java.lang.String getAllCategorizedValuesWithNames()
          Return all of the categorized monetary values and names.
 java.util.Hashtable getCategorizedAmountsAndNames()
          Get the categorized names and monetary amounts hashtable.
 java.util.Hashtable getCategorizedAmountsDBAndNames()
          Get the categorized names and MonetaryAmountDataBean hashtable.
 java.util.Hashtable getCategorizedDescriptionsAndNames()
          Get the categorized descriptions and names hashtable.
 java.math.BigDecimal getCategoryAmount()
          Get the category monetary value.
 java.lang.String getCategoryName()
          Get the category name.
 CommandContext getCommandContext()
          Get the command context.
 java.lang.String getCurrency()
          Get the monetary currency.
 int getNoOfCategories()
          Return the total number of categories.
 TypedProperty getRequestProperties()
          Get the request properties.
 java.lang.String getTotalCategorizedAmount()
          Return the total of all the categorized amounts.
 java.lang.String getTotalCategorizedValue()
          Return the total of all the categorized amount values.
 void populate()
          Create the hashtable that contains the categories and their corresponding monetary amounts.
 void setCategorizedAmountsAndNames(java.util.Hashtable aCategorizedAmounts)
          Set the categorized names and monetary amounts hashtable.
 void setCategorizedAmountsDBAndNames(java.util.Hashtable aCategorizedAmountsDB)
          Set the categorized names and MonetaryAmountDataBean hashtable.
 void setCategorizedDescriptionsAndNames(java.util.Hashtable aCategorizedDescriptionsAndNames)
          Set the categorized descriptions and names hashtable.
 void setCategorizedValuesAndNames(java.util.Hashtable aCategorizedValues)
          Set the categorized values and names hashtable.
 void setCategoryAmount(java.math.BigDecimal aCategoryAmount)
          Set the category value.
 void setCategoryName(java.lang.String aCgryName)
          Set the category name.
 void setCommandContext(CommandContext commandContext)
          Set the command context.
 void setCurrency(java.lang.String aCurrency)
          Set the monetary currency.
 void setRequestProperties(TypedProperty param)
          Set the request properties.
 java.lang.String toString()
          Returns all of the categorized monetary amounts or monetary values and their corresponding category names.
 
Methods inherited from class com.ibm.commerce.price.utils.MonetaryAmountDataBean
getCounterValueListPrefix, getCounterValueListSeparator, getCounterValueListSuffix, getFormattedCounterValues, getPrimaryFormattedPrice, getPrimaryPrice, isShowCounterValues, setCounterValueListPrefix, setCounterValueListSeparator, setCounterValueListSuffix, setPrimaryPrice, setShowCounterValues
 
Methods inherited from class com.ibm.commerce.price.utils.UnitAmountDataBeanImpl
formatAmount, getCustomizedString, getDescription, getLangId, getNumberUsage, getPrimaryAmount, getPrimaryFormattedAmount, getStoreAccessBean, getSymbol, roundAmount, setLangId, setNumberUsage, setPrimaryAmount, setStoreAccessBean, setUnitManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CategorizedMonetaryAmountsDataBean

public CategorizedMonetaryAmountsDataBean()
CategorizedMonetaryAmountFormatter constructor.

CategorizedMonetaryAmountsDataBean

public CategorizedMonetaryAmountsDataBean(MonetaryAmount aMonetaryAmount,
                                          StoreAccessBean aStoreAccessBean,
                                          java.lang.Integer aLangId,
                                          java.lang.String aCategoryName)
CategorizedMonetaryAmountFormatter constructor.
Parameters:
aMonetaryAmount - com.ibm.commerce.price.utils.MonetaryAmount

CategorizedMonetaryAmountsDataBean

public CategorizedMonetaryAmountsDataBean(MonetaryAmount aMonetaryAmount,
                                          StoreAccessBean aStoreAccessBean,
                                          java.lang.Integer aLangId,
                                          java.lang.String aCategoryName,
                                          java.util.Hashtable aDescHash,
                                          java.util.Hashtable aAmountHash,
                                          java.util.Hashtable aAmountDBHash)
CategorizedMonetaryAmountFormatter constructor.
Parameters:
aMonetaryAmount - com.ibm.commerce.price.utils.MonetaryAmount
Method Detail

getACategorizedAmountWithName

public java.lang.String getACategorizedAmountWithName(java.lang.String aCategory)
Return the monetary amount and name of a particular category.
Specified by:
getACategorizedAmountWithName in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the String representing monetary amount and the corresponding name of a particular category.

getACategorizedValueWithName

public java.lang.String getACategorizedValueWithName(java.lang.String aCategory)
Return the monetary value and name of a particular category.
Specified by:
getACategorizedValueWithName in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the String representing monetary value and the corresponding name of a particular category.

getAllCategorizedAmountsWithNames

public java.lang.String getAllCategorizedAmountsWithNames()
Return all of the categorized monetary amounts and names.
Specified by:
getAllCategorizedAmountsWithNames in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the String representing all of the categorized monetary amounts and the corresponding category names.

getAllCategorizedValuesWithNames

public java.lang.String getAllCategorizedValuesWithNames()
Return all of the categorized monetary values and names.
Specified by:
getAllCategorizedValuesWithNames in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the String representing all of the categorized monetary values and the corresponding category names.

getCategorizedAmountsAndNames

public java.util.Hashtable getCategorizedAmountsAndNames()
Get the categorized names and monetary amounts hashtable.
Specified by:
getCategorizedAmountsAndNames in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the Hashtable containing the categorized names and monetary amounts.

getCategorizedAmountsDBAndNames

public java.util.Hashtable getCategorizedAmountsDBAndNames()
Get the categorized names and MonetaryAmountDataBean hashtable.
Specified by:
getCategorizedAmountsDBAndNames in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the Hashtable containing the categorized names and MonetaryAmountDataBean.

getCategorizedDescriptionsAndNames

public java.util.Hashtable getCategorizedDescriptionsAndNames()
Get the categorized descriptions and names hashtable.
Specified by:
getCategorizedDescriptionsAndNames in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the Hashtable containing the categorized descriptions and names.

getCategoryAmount

public java.math.BigDecimal getCategoryAmount()
Get the category monetary value.
Specified by:
getCategoryAmount in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the BigDecimal containing the monetary value.

getCategoryName

public java.lang.String getCategoryName()
Get the category name.
Specified by:
getCategoryName in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the String containing the category name.

getCommandContext

public CommandContext getCommandContext()
Get the command context.
Returns:
the com.ibm.commerce.command.CommandContext.

getCurrency

public java.lang.String getCurrency()
Get the monetary currency.
Specified by:
getCurrency in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the String representing the monetary currency.

getNoOfCategories

public int getNoOfCategories()
Return the total number of categories.
Specified by:
getNoOfCategories in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the intcontaining the total numbers of categories.

getRequestProperties

public TypedProperty getRequestProperties()
Get the request properties.
Returns:
the com.ibm.commerce.datatype.TypedProperty containing the request properties.

getTotalCategorizedAmount

public java.lang.String getTotalCategorizedAmount()
Return the total of all the categorized amounts.
Specified by:
getTotalCategorizedAmount in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the String representing the total monetary amount.

getTotalCategorizedValue

public java.lang.String getTotalCategorizedValue()
Return the total of all the categorized amount values.
Specified by:
getTotalCategorizedValue in interface CategorizedMonetaryAmountsSmartDataBean
Returns:
the String representing the total monetary value.

populate

public void populate()
              throws java.lang.Exception
Create the hashtable that contains the categories and their corresponding monetary amounts.

setCategorizedAmountsAndNames

public void setCategorizedAmountsAndNames(java.util.Hashtable aCategorizedAmounts)
Set the categorized names and monetary amounts hashtable.
Specified by:
setCategorizedAmountsAndNames in interface CategorizedMonetaryAmountsInputDataBean
Parameters:
aCategorizedAmount - the categorized amounts and names hashtable.

setCategorizedAmountsDBAndNames

public void setCategorizedAmountsDBAndNames(java.util.Hashtable aCategorizedAmountsDB)
Set the categorized names and MonetaryAmountDataBean hashtable.
Specified by:
setCategorizedAmountsDBAndNames in interface CategorizedMonetaryAmountsInputDataBean
Parameters:
aCategorizedAmountsDB - the categorized amounts databean and names hashtable.

setCategorizedDescriptionsAndNames

public void setCategorizedDescriptionsAndNames(java.util.Hashtable aCategorizedDescriptionsAndNames)
Set the categorized descriptions and names hashtable.
Specified by:
setCategorizedDescriptionsAndNames in interface CategorizedMonetaryAmountsInputDataBean
Parameters:
aCategorizedDescription - the categorized descriptions and names hashtable.

setCategorizedValuesAndNames

public void setCategorizedValuesAndNames(java.util.Hashtable aCategorizedValues)
Set the categorized values and names hashtable.
Specified by:
setCategorizedValuesAndNames in interface CategorizedMonetaryAmountsInputDataBean
Parameters:
aCategorizedValue - the categorized values and names hashtable.

setCategoryAmount

public void setCategoryAmount(java.math.BigDecimal aCategoryAmount)
Set the category value.
Specified by:
setCategoryAmount in interface CategorizedMonetaryAmountsInputDataBean
Parameters:
aCategoryAmount - the category value.

setCategoryName

public void setCategoryName(java.lang.String aCgryName)
Set the category name.
Specified by:
setCategoryName in interface CategorizedMonetaryAmountsInputDataBean
Parameters:
aCgryName - the category name.

setCommandContext

public void setCommandContext(CommandContext commandContext)
Set the command context.
Parameters:
commandContext - com.ibm.commerce.command.CommandContext.

setCurrency

public void setCurrency(java.lang.String aCurrency)
Set the monetary currency.
Specified by:
setCurrency in interface CategorizedMonetaryAmountsInputDataBean
Parameters:
aCurrency - the monetary currency.

setRequestProperties

public void setRequestProperties(TypedProperty param)
                          throws java.lang.Exception
Set the request properties.
Parameters:
param - com.ibm.commerce.datatype.TypedProperty.

toString

public java.lang.String toString()
Returns all of the categorized monetary amounts or monetary values and their corresponding category names.
Specified by:
toString in interface CategorizedMonetaryAmountsSmartDataBean
Overrides:
toString in class MonetaryAmountDataBean
Returns:
the String representing all of the categorized monetary amounts or monetary values and their corresponding category names.