java.lang.Object | +--com.ibm.commerce.price.utils.UnitManager
Abstract base class for manager classes.
Field Summary | |
---|---|
static int |
ROUND_METHOD_ROUND |
static int |
ROUND_METHOD_TRUNCATION |
Fields inherited from interface com.ibm.commerce.registry. Registry |
COPYRIGHT |
Constructor Summary | |
---|---|
protected |
UnitManager(Converters aConverters, Formatters aFormatters,
FormattedUnitAmount aFormattedUnitAmount, FormatDesc aFormatDesc) UnitManager constructor. |
Method Summary | |
---|---|
protected
boolean |
checkStoreGroupConverter() Do we check that there is a store group level converter? IBM Internal Use Only. |
protected
UnitAmount |
convert(UnitAmount aUnitAmount,
StoreAccessBean aStoreAccessBean,
java.lang.String toUnit) Convert a unit amount to a new unit. |
protected
abstract java.lang.String |
getClassName() Get the class name. |
protected
abstract java.lang.String |
getConverionRelationshipType() Gets the conversion relationship type. |
protected
java.lang.Integer[] |
getConversionStorePath(
StoreAccessBean theStoreAB) Gets the conversion store path. |
protected
Converter |
getConverter(
StoreAccessBean aStoreAccessBean, java.lang.String aFromUnit,
java.lang.String aToUnit) Get the appropriate converter in the specified store. |
protected
Converters |
getConverters() Get the converters container. |
protected
java.math.BigDecimal |
getCustomizedRoundingMultipleBD(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aNumbrUsgId) Get the customized rounding multiple as a BigDecimal. |
protected
java.math.BigDecimal |
getCustomizedRoundingMultipleBD(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.String aNumberUsage) Get the customized rounding multiple as a BigDecimal. |
protected
java.lang.Double |
getCustomizedRoundingMultipleD(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aNumbrUsgId) Get the customized rounding multiple as a Double. |
protected
java.lang.Double |
getCustomizedRoundingMultipleD(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.String aNumberUsage) Get the customized rounding multiple as a Double. |
int |
getCustomizedRoundMethod(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit) Get the rounding method used for a particular unit. |
int |
getCustomizedRoundMethod(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.String aNumberUsage) Get the rounding method used for a particular unit. |
protected
java.lang.String |
getCustomizedString(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) Get the customized string from the format table. |
java.lang.String |
getCustomizedString(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aLanguageId, java.lang.String aNumberUsage) Get the customized string from the format table. |
protected
java.lang.String |
getDescription(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) Get the description of the specified units. |
java.lang.String |
getDescription(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aLanguageId, java.lang.String aNumberUsage) Get the description of the specified units. |
protected
FormatDesc |
getFormatDescription(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) Get a format description record. |
protected
abstract java.lang.String |
getFormatRelationshipType() Gets the format relationship type. |
protected
FormattedUnitAmount |
getFormattedUnitAmount(UnitAmount aUnitAmount,
StoreAccessBean aStoreAccessBean,
java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) Get a formatted unit amount for display purposes based on the formatting rules defined in the database. |
protected
FormattedUnitAmount |
getFormattedUnitAmount(UnitAmount aUnitAmount,
StoreAccessBean aStoreAccessBean,
java.lang.Integer aLanguageId, java.lang.String aNumberUsage) Get a formatted unit amount for display purposes based on the formatting rules defined in the database. |
protected
Formatter |
getFormatter(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aNumbrUsgId) Get the formatter with the specified number usage identifer for the store. |
protected
Converter |
getParticularConverter(java.lang.Integer aStoreEntityId,
java.lang.String fromUnit, java.lang.String toUnit) IBM Internal Use Only. |
protected
java.math.BigDecimal |
getRoundingMultipleBD(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aNumbrUsgId) Get the rounding multiple as a BigDecimal. |
protected
java.math.BigDecimal |
getRoundingMultipleBD(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.String aNumberUsage) Get the rounding multiple as a BigDecimal. |
protected
java.lang.Double |
getRoundingMultipleD(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aNumbrUsgId) Get the rounding multiple as a Double. |
protected
java.lang.Double |
getRoundingMultipleD(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.String aNumberUsage) Get the rounding multiple as a Double. |
protected
StoreAccessBean |
getStoreAB(java.lang.Integer aStoreId) Gets the store access bean associated with the specified store ID. |
protected
abstract java.lang.Integer |
getStoreIdForConverter(
StoreAccessBean aStoreAccessBean) Get the storeId to use to search for a converter. |
protected
java.lang.Integer[] |
getStorePath(java.lang.String theRelationShipType,
StoreAccessBean theStoreAB) Gets the store path for the specified store and relationship type. |
protected
java.lang.String |
getSymbol(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) Get the symbol information from the format table. |
java.lang.String |
getSymbol(
StoreAccessBean aStoreAccessBean, java.lang.String aUnit,
java.lang.Integer aLanguageId, java.lang.String aNumberUsage) Get the symbol information from the format table. |
protected
java.lang.Number |
parsePositiveUnitAmount(java.lang.String anAmount,
java.lang.String theUnit,
StoreAccessBean aStoreAccessBean,
java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) Parses a string (representing a positive number) based on the formatting rules defined in the database. |
protected
java.lang.Number |
parsePositiveUnitAmount(java.lang.String anAmount,
java.lang.String theUnit,
StoreAccessBean aStoreAccessBean,
java.lang.Integer aLanguageId, java.lang.String aNumberUsage) Parses a string (representing a positive number) based on the formatting rules defined in the database. |
void |
refresh() Refresh the manager cache. |
protected
void |
refreshCache(Converters aConverters, Formatters aFormatters,
int theCacheToRefresh) Refresh the cache. |
protected
void |
refreshExtension(Formatters theTempFormatters) Extension to the refresh. |
protected
void |
refreshOthers(Converters aConverters) Refresh other containers. |
protected
java.lang.Integer |
resolveNumberUsageId(java.lang.String aNumberUsage) Resolve the number usage code to an Id. |
protected
void |
round(UnitAmount aUnitAmount,
StoreAccessBean aStoreAccessBean,
java.lang.Integer aNumbrUsgId) Round the unit amount to the appropriate number of decimal places. |
protected
void |
round(UnitAmount aUnitAmount,
StoreAccessBean aStoreAccessBean,
java.lang.String aNumberUsage) Round the unit amount to the appropriate number of decimal places. |
protected
void |
roundCustomized(UnitAmount aUnitAmount,
StoreAccessBean aStoreAccessBean,
java.lang.Integer aNumbrUsgId) Perform customized rounding to the correct number of decimal places. |
protected
void |
roundCustomized(UnitAmount aUnitAmount,
StoreAccessBean aStoreAccessBean,
java.lang.String aNumberUsage) Perform customized rounding to the correct number of decimal places. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Methods inherited from interface com.ibm.commerce.registry. Registry |
initialize |
Field Detail |
---|
public static final int ROUND_METHOD_TRUNCATION
public static final int ROUND_METHOD_ROUND
Constructor Detail |
---|
protected UnitManager(Converters aConverters, Formatters aFormatters, FormattedUnitAmount aFormattedUnitAmount, FormatDesc aFormatDesc) throws ECSystemException
Method Detail |
---|
protected boolean checkStoreGroupConverter()
protected java.lang.Integer[] getStorePath(java.lang.String theRelationShipType, StoreAccessBean theStoreAB) throws ECSystemException
theRelationShipType
- The relationship type.theStoreAB
- The store access bean to use to get the store
path.
ECSystemException
- Raised with the equivalent message of any EJB
exceptions.protected java.lang.Integer[] getConversionStorePath(StoreAccessBean theStoreAB) throws ECSystemException
theStoreAB
- The store access bean to use to get the store
path.
ECSystemException
protected abstract java.lang.String getConverionRelationshipType()
protected abstract java.lang.String getFormatRelationshipType()
protected StoreAccessBean getStoreAB(java.lang.Integer aStoreId) throws ECSystemException
aStoreId
- The store ID.
ECSystemException
- Raised with the message _ERR_BAD_STORE_STATE if
no store access bean is found.protected UnitAmount convert(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.String toUnit) throws ECSystemException
aUnitAmount
- a unit amount to be converted.aStoreAccessBean
- the store access bean to use to choose the
appropriate conversion rules.toUnit
- the unit to convert to.
ECSystemException
protected abstract java.lang.String getClassName()
protected Converter getConverter(StoreAccessBean aStoreAccessBean, java.lang.String aFromUnit, java.lang.String aToUnit) throws ECSystemException
aStoreAccessBean
- The store access bean who owns the
conversion.aFromUnit
- The from unit of the conversion.aToUnit
- The to unit of the conversion.
ECSystemException
protected Converters getConverters()
protected java.math.BigDecimal getCustomizedRoundingMultipleBD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
aStoreAccessBean
- The store for which the rounding multiple
applies.aUnit
- The unit for which the rounding multiple applies.aNumbrUsgId
- The number usage identifier to use.
ECSystemException
protected java.math.BigDecimal getCustomizedRoundingMultipleBD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
aStoreAccessBean
- The store for which the rounding multiple
applies.aUnit
- The unit for which the rounding multiple applies.aNumberUsage
- The number usage code to use.
ECSystemException
protected java.lang.Double getCustomizedRoundingMultipleD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
aStoreAccessBean
- The store for which the rounding multiple
applies.aUnit
- The unit for which the rounding multiple applies.aNumbrUsgId
- The number usage identifier to use.
ECSystemException
protected java.lang.Double getCustomizedRoundingMultipleD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
aStoreAccessBean
- The store for which the rounding multiple
applies.aUnit
- The unit for which the rounding multiple applies.aNumberUsage
- The number usage code to use.
ECSystemException
public int getCustomizedRoundMethod(StoreAccessBean aStoreAccessBean, java.lang.String aUnit) throws ECSystemException
aStoreAccessBean
- the store for which the rounding method
applies.aUnit
- the unit for which the rounding method applies.
ECSystemException
public int getCustomizedRoundMethod(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
aStoreAccessBean
- the store for which the rounding method
applies.aUnit
- the unit for which the rounding method applies.aNumberUsage
- the number usage code.
ECSystemException
protected java.lang.String getCustomizedString(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
aStoreAccessBean
- the store for choosing the appropriate
rule.aUnit
- the unit for which to choose the customized
string.aLanguageId
- the language Id of the language for the
customized string.
ECSystemException
public java.lang.String getCustomizedString(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
aStoreAccessBean
- the store for choosing the appropriate
rule.aUnit
- the unit for which to choose the customized
string.aLanguageId
- the language Id of the language for the
customized string.aNumberUsage
- the number usage code.
ECSystemException
protected java.lang.String getDescription(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
aStoreAccessBean
- the store that the description applies
to.aUnit
- the units that the description is for.aLanguageId
- the language Id of the language for the
description.
ECSystemException
public java.lang.String getDescription(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
aStoreAccessBean
- the store that the description applies
to.aUnit
- the units that the description is for.aLanguageId
- the language Id of the language for the
description.aNumberUsage
- the number usage code.
ECSystemException
protected FormatDesc getFormatDescription(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
aStoreAccessBean
- The store access bean.aUnit
- The unit.aLanguageId
- The language ID.
ECSystemException
protected FormattedUnitAmount getFormattedUnitAmount(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
aUnitAmount
- the unit amount to format.aStoreAccessBean
- a store access bean.aLanguageId
- a language ID.aNumbrUsgId
- The number usage identifier to use.
ECSystemException
protected FormattedUnitAmount getFormattedUnitAmount(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
aUnitAmount
- the unit amount to format.aStoreAccessBean
- a store access bean.aLanguageId
- a language ID.aNumberUsage
- The number usage code to use.
ECSystemException
protected Formatter getFormatter(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
aStoreAccessBean
- The store access bean.aUnit
- The unit for the formatter.aNumbrUsgId
- The number usage identifier to use.
ECSystemException
protected Converter getParticularConverter(java.lang.Integer aStoreEntityId, java.lang.String fromUnit, java.lang.String toUnit)
protected java.math.BigDecimal getRoundingMultipleBD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
aStoreAccessBean
- The store for which the rounding multiple
applies.aUnit
- The unit for which the rounding multiple applies.aNumbrUsgId
- The number usage identifier to use.
ECSystemException
protected java.math.BigDecimal getRoundingMultipleBD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
aStoreAccessBean
- The store for which the rounding multiple
applies.aUnit
- The unit for which the rounding multiple applies.aNumberUsage
- The number usage code to use.
ECSystemException
protected java.lang.Double getRoundingMultipleD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
aStoreAccessBean
- The store for which the rounding multiple
applies.aUnit
- The unit for which the rounding multiple applies.aNumbrUsgId
- The number usage identifier to use.
ECSystemException
protected java.lang.Double getRoundingMultipleD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
aStoreAccessBean
- The store for which the rounding multiple
applies.aUnit
- The unit for which the rounding multiple applies.aNumberUsage
- The number usage code to use.
ECSystemException
protected abstract java.lang.Integer getStoreIdForConverter(StoreAccessBean aStoreAccessBean) throws ECSystemException
aStoreAccessBean
-
com.ibm.commerce.common.objects.StoreAccessBean
ECSystemException
protected java.lang.String getSymbol(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
aStoreAccessBean
- the store.aUnit
- the unit.aLanguageId
- the language Id of the language for the
symbol.aNumbrUsgId
- The number usage identifier to use.
ECSystemException
public java.lang.String getSymbol(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
aStoreAccessBean
- the store.aUnit
- the unit.aLanguageId
- the language Id of the language for the
symbol.aNumberUsage
- the number usage code.
ECSystemException
public void refresh() throws ECSystemException
refresh
in interface
Registry
ECSystemException
protected void refreshCache(Converters aConverters, Formatters aFormatters, int theCacheToRefresh) throws ECSystemException
ECSystemException
protected void refreshExtension(Formatters theTempFormatters) throws ECSystemException
theTempFormatters
-
com.ibm.commerce.price.utils.Formatters
ECSystemException
protected void refreshOthers(Converters aConverters) throws ECSystemException
ECSystemException
protected java.lang.Integer resolveNumberUsageId(java.lang.String aNumberUsage) throws ECSystemException
aNumberUsage
- The number usage code.
ECSystemException
protected void round(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aNumbrUsgId) throws ECSystemException
aUnitAmount
- the unit amount to round.aStoreAccessBean
- the store.
ECSystemException
protected void round(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage) throws ECSystemException
aUnitAmount
- the unit amount to round.aStoreAccessBean
- the store.aNumberUsage
- the number usage code.
ECSystemException
protected void roundCustomized(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aNumbrUsgId) throws ECSystemException
aUnitAmount
- the unit amount to round.aStoreAccessBean
- the store.
ECSystemException
protected void roundCustomized(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage) throws ECSystemException
aUnitAmount
- the unit amount to round.aStoreAccessBean
- the store.aNumberUsage
- the number usage code.
ECSystemException
protected java.lang.Number parsePositiveUnitAmount(java.lang.String anAmount, java.lang.String theUnit, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws java.text.ParseException, ECSystemException
anAmount
- the amount to parse.theUnit
- the unit of the value.aStoreAccessBean
- a store access bean.aLanguageId
- a language ID.aNumbrUsgId
- The number usage identifier to use.java.text.ParseException
ECSystemException
protected java.lang.Number parsePositiveUnitAmount(java.lang.String anAmount, java.lang.String theUnit, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws java.text.ParseException, ECSystemException
anAmount
- the amount to parse.theUnit
- the unit of the value.aStoreAccessBean
- a store access bean.aLanguageId
- a language ID.aNumberUsage
- The number usage code to use.java.text.ParseException
ECSystemException