public abstract class UnitManager extends java.lang.Object implements Registry
Modifier and Type | Field and Description |
---|---|
static int | ROUND_METHOD_FLOOR
Rounding method of floor with value 3.
|
static int | ROUND_METHOD_ROUND
Rounding method of round with value 2.
|
static int | ROUND_METHOD_TRUNCATION
Rounding method of truncation with value 1.
|
Modifier | Constructor and Description |
---|---|
protected | UnitManager(com.ibm.commerce.price.utils.Converters aConverters, com.ibm.commerce.price.utils.Formatters aFormatters, com.ibm.commerce.price.utils.FormattedUnitAmount aFormattedUnitAmount, com.ibm.commerce.price.utils.FormatDesc aFormatDesc)
UnitManager constructor.
|
Modifier and Type | Method and Description |
---|---|
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 com.ibm.commerce.price.utils.Converter | getConverter(StoreAccessBean aStoreAccessBean, java.lang.String aFromUnit, java.lang.String aToUnit)
Get the appropriate converter in the specified store.
|
protected com.ibm.commerce.price.utils.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
|
protected java.math.BigDecimal | getCustomizedRoundingMultipleBD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage)
Get the customized rounding multiple as a
|
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 com.ibm.commerce.price.utils.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 com.ibm.commerce.price.utils.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 com.ibm.commerce.price.utils.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 com.ibm.commerce.price.utils.Formatter | getFormatter(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId)
Get the formatter with the specified number usage identifier for the store.
|
int | getNumberOfDecimalPlaces(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId)
Get the number of decimal places for a particular unit.
|
int | getNumberOfDecimalPlaces(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage)
Get the number of decimal places for a particular unit.
|
protected com.ibm.commerce.price.utils.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
|
protected java.math.BigDecimal | getRoundingMultipleBD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage)
Get the rounding multiple as a
|
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.
|
boolean | isRefreshRequired()
Returns true if the registry needs to be refreshed before it can be used.
|
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(com.ibm.commerce.price.utils.Converters aConverters, com.ibm.commerce.price.utils.Formatters aFormatters, int theCacheToRefresh)
Refresh the cache.
|
protected void | refreshExtension(com.ibm.commerce.price.utils.Formatters theTempFormatters)
Extension to the refresh.
|
protected void | refreshIfRequired()
Refreshes the registry if the refreshRegistry property is true, and sets the refreshRegistry property to false.
|
protected void | refreshOthers(com.ibm.commerce.price.utils.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.
|
void | setRefreshRequired()
Sets the refreshRequired property to true, indicating that the registry must be refreshed before it can be used.
|
public static final int ROUND_METHOD_TRUNCATION
public static final int ROUND_METHOD_ROUND
public static final int ROUND_METHOD_FLOOR
protected UnitManager(com.ibm.commerce.price.utils.Converters aConverters, com.ibm.commerce.price.utils.Formatters aFormatters, com.ibm.commerce.price.utils.FormattedUnitAmount aFormattedUnitAmount, com.ibm.commerce.price.utils.FormatDesc aFormatDesc) throws ECSystemException
public void setRefreshRequired()
public boolean isRefreshRequired()
protected void refreshIfRequired() throws ECSystemException
protected boolean checkStoreGroupConverter()
protected java.lang.Integer[] getStorePath(java.lang.String theRelationShipType, StoreAccessBean theStoreAB) throws ECSystemException
protected java.lang.Integer[] getConversionStorePath(StoreAccessBean theStoreAB) throws ECSystemException
protected abstract java.lang.String getConverionRelationshipType()
protected abstract java.lang.String getFormatRelationshipType()
protected StoreAccessBean getStoreAB(java.lang.Integer aStoreId) throws ECSystemException
protected UnitAmount convert(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.String toUnit) throws ECSystemException
protected abstract java.lang.String getClassName()
protected com.ibm.commerce.price.utils.Converter getConverter(StoreAccessBean aStoreAccessBean, java.lang.String aFromUnit, java.lang.String aToUnit) throws ECSystemException
protected com.ibm.commerce.price.utils.Converters getConverters()
protected java.math.BigDecimal getCustomizedRoundingMultipleBD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
BigDecimal.
protected java.math.BigDecimal getCustomizedRoundingMultipleBD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
BigDecimal.
protected java.lang.Double getCustomizedRoundingMultipleD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
protected java.lang.Double getCustomizedRoundingMultipleD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
public int getCustomizedRoundMethod(StoreAccessBean aStoreAccessBean, java.lang.String aUnit) throws ECSystemException
public final int getNumberOfDecimalPlaces(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
public final int getNumberOfDecimalPlaces(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
public int getCustomizedRoundMethod(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
protected java.lang.String getCustomizedString(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
public java.lang.String getCustomizedString(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
protected java.lang.String getDescription(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
public java.lang.String getDescription(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
protected com.ibm.commerce.price.utils.FormatDesc getFormatDescription(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
protected com.ibm.commerce.price.utils.FormattedUnitAmount getFormattedUnitAmount(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
protected com.ibm.commerce.price.utils.FormattedUnitAmount getFormattedUnitAmount(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
protected com.ibm.commerce.price.utils.Formatter getFormatter(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
protected com.ibm.commerce.price.utils.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
BigDecimal.
protected java.math.BigDecimal getRoundingMultipleBD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
BigDecimal.
protected java.lang.Double getRoundingMultipleD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId) throws ECSystemException
protected java.lang.Double getRoundingMultipleD(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
protected abstract java.lang.Integer getStoreIdForConverter(StoreAccessBean aStoreAccessBean) throws ECSystemException
protected java.lang.String getSymbol(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.Integer aNumbrUsgId) throws ECSystemException
public java.lang.String getSymbol(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
public void refresh() throws ECSystemException
protected void refreshCache(com.ibm.commerce.price.utils.Converters aConverters, com.ibm.commerce.price.utils.Formatters aFormatters, int theCacheToRefresh) throws ECSystemException
protected void refreshExtension(com.ibm.commerce.price.utils.Formatters theTempFormatters) throws ECSystemException
protected void refreshOthers(com.ibm.commerce.price.utils.Converters aConverters) throws ECSystemException
protected java.lang.Integer resolveNumberUsageId(java.lang.String aNumberUsage) throws ECSystemException
protected void round(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aNumbrUsgId) throws ECSystemException
roundingMultipleand
roundingMethodcolumns of the format table.
protected void round(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage) throws ECSystemException
roundingMultipleand
roundingMethodcolumns of the format table.
protected void roundCustomized(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aNumbrUsgId) throws ECSystemException
roundingMultipleand
roundingMethodcolumns of the currency format table.
protected void roundCustomized(UnitAmount aUnitAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage) throws ECSystemException
roundingMultipleand
roundingMethodcolumns of the currency 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) throws 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