public class QuantityManager extends UnitManager
Modifier | Constructor and Description |
---|---|
protected | QuantityManager()
QuantityManager 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.
|
QuantityAmount | convert(QuantityAmount aQuantityAmount, java.lang.String toQuantityUnit)
Convert a quantity amount to a new quantity unit.
|
protected java.lang.String | getClassName()
Get the class name.
|
protected java.lang.String | getConverionRelationshipType()
Returns null because there is no measurement conversion type.
|
protected java.lang.Integer[] | getConversionStorePath(StoreAccessBean theStoreAB)
Gets the conversion store path.
|
java.util.List | getConvertableUnits(java.lang.String aUnit)
Get all quantity units that can be converted from/to
|
java.lang.Double | getCustomizedRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit)
Gets the unit to which rounding occurs.
|
java.lang.Double | getCustomizedRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage)
Gets the unit to which rounding occurs.
|
java.lang.String | getCustomizedString(StoreAccessBean aStoreAccessBean, java.lang.String aQuantityUnit, java.lang.Integer aLanguageId)
Get the customized string from the format table.
|
java.lang.String | getDescription(StoreAccessBean aStoreAccessBean, java.lang.String aQuantityUnit, java.lang.Integer aLanguageId)
Get the description of the specified quantity unit.
|
protected java.lang.String | getFormatRelationshipType()
Gets the format relationship type.
|
FormattedQuantityAmount | getFormattedQuantityAmount(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId)
Get a formatted quantity amount for display purposes based on the formatting rules defined in the database.
|
FormattedQuantityAmount | getFormattedQuantityAmount(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage)
Get a formatted quantity amount for display purposes based on the formatting rules defined in the database.
|
static QuantityManager | getInstance()
Get the instance of the quantity manager.
|
java.lang.Double | getRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit)
Gets the unit to which rounding occurs.
|
java.lang.Double | getRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage)
Gets the unit to which rounding occurs.
|
protected java.lang.Integer | getStoreIdForConverter(StoreAccessBean aStoreAccessBean)
Get the store Id to use for converters.
|
java.lang.String | getSymbol(StoreAccessBean aStoreAccessBean, java.lang.String aQuantityUnit, java.lang.Integer aLanguageId)
Get the quantity symbol information from the quantity format table.
|
void | initialize()
Used by the registry manager to initialize the quantity manager.
|
java.lang.Double | parsePositiveAmount(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 | round(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean)
Round the quantity amount to the appropriate number of decimal places.
|
void | round(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage)
Round the quantity amount to the appropriate number of decimal places.
|
void | roundCustomized(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean)
Perform customized rounding to the correct number of decimal places.
|
void | roundCustomized(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage)
Perform customized rounding to the correct number of decimal places.
|
protected QuantityManager() throws ECSystemException
protected boolean checkStoreGroupConverter()
protected java.lang.Integer[] getConversionStorePath(StoreAccessBean theStoreAB) throws ECSystemException
protected java.lang.String getConverionRelationshipType()
protected java.lang.String getFormatRelationshipType()
public QuantityAmount convert(QuantityAmount aQuantityAmount, java.lang.String toQuantityUnit) throws ECSystemException
protected java.lang.String getClassName()
public java.util.List getConvertableUnits(java.lang.String aUnit)
aUnit.
aUnit- the starting quantity unit.
aUnit(including
aUnit).
public java.lang.Double getCustomizedRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit) throws ECSystemException
aUnit- the quantity unit for which the rounding applies.
public java.lang.Double getCustomizedRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
aUnit- the quantity unit for which the rounding applies.
public java.lang.String getCustomizedString(StoreAccessBean aStoreAccessBean, java.lang.String aQuantityUnit, java.lang.Integer aLanguageId) throws ECSystemException
public java.lang.String getDescription(StoreAccessBean aStoreAccessBean, java.lang.String aQuantityUnit, java.lang.Integer aLanguageId) throws ECSystemException
public FormattedQuantityAmount getFormattedQuantityAmount(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId) throws ECSystemException
public FormattedQuantityAmount getFormattedQuantityAmount(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
public static QuantityManager getInstance() throws ECSystemException
public java.lang.Double getRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit) throws ECSystemException
aUnit- the quantity unit for which the rounding applies.
public java.lang.Double getRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
aUnit- the quantity unit for which the rounding applies.
protected java.lang.Integer getStoreIdForConverter(StoreAccessBean aStoreAccessBean) throws ECSystemException
SITE_LEVEL_STORE_ID
public java.lang.String getSymbol(StoreAccessBean aStoreAccessBean, java.lang.String aQuantityUnit, java.lang.Integer aLanguageId) throws ECSystemException
public void initialize() throws java.lang.Exception
public void round(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean) throws ECSystemException
roundingMultipleand
roundingMethodcolumns of the quantity format table.
public void round(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage) throws ECSystemException
roundingMultipleand
roundingMethodcolumns of the quantity format table.
public void roundCustomized(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean) throws ECSystemException
roundingMultipleand
roundingMethodcolumns of the quantity format table.
public void roundCustomized(QuantityAmount aQuantityAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage) throws ECSystemException
roundingMultipleand
roundingMethodcolumns of the quantity format table.
public java.lang.Double parsePositiveAmount(java.lang.String anAmount, java.lang.String theUnit, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException, java.text.ParseException