com.ibm.commerce.price.utils

Class UnitManager

  • java.lang.Object
    • com.ibm.commerce.price.utils.UnitManager
  • All Implemented Interfaces:
    com.ibm.commerce.registry.Registry
    Direct Known Subclasses:
    CurrencyManager, QuantityManager


    public abstract class UnitManager
    extends java.lang.Object
    implements com.ibm.commerce.registry.Registry
    Abstract base class for manager classes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int getCustomizedRoundMethod(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean, java.lang.String aUnit)
      Get the rounding method used for a particular unit.
      int getCustomizedRoundMethod(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage)
      Get the rounding method used for a particular unit.
      java.lang.String getCustomizedString(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.String aNumberUsage)
      Get the customized string from the format table.
      java.lang.String getDescription(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aLanguageId, java.lang.String aNumberUsage)
      Get the description of the specified units.
      int getNumberOfDecimalPlaces(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.Integer aNumbrUsgId)
      Get the number of decimal places for a particular unit.
      int getNumberOfDecimalPlaces(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage)
      Get the number of decimal places for a particular unit.
      java.lang.String getSymbol(com.ibm.commerce.common.objects.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.
      void refresh()
      Refresh the manager cache.
      void setRefreshRequired()
      Sets the refreshRequired property to true, indicating that the registry must be refreshed before it can be used.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.ibm.commerce.registry.Registry

        initialize
    • Field Detail

      • ROUND_METHOD_FLOOR

        public static final int ROUND_METHOD_FLOOR
        Rounding method of floor with value 3.
        See Also:
        Constant Field Values
      • ROUND_METHOD_ROUND

        public static final int ROUND_METHOD_ROUND
        Rounding method of round with value 2.
        See Also:
        Constant Field Values
      • ROUND_METHOD_TRUNCATION

        public static final int ROUND_METHOD_TRUNCATION
        Rounding method of truncation with value 1.
        See Also:
        Constant Field Values
    • Method Detail

      • getCustomizedRoundMethod

        public int getCustomizedRoundMethod(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean,
                                            java.lang.String aUnit)
                                     throws com.ibm.commerce.exception.ECSystemException
        Get the rounding method used for a particular unit. This method returns 1 if the round method is 'T' (Truncate), returns 2 if the round method is 'R' (Round) or returns 3 if the round method is 'F' (Floor).
        Parameters:
        aStoreAccessBean - the store for which the rounding method applies.
        aUnit - the unit for which the rounding method applies.
        Returns:
        the rounding method.
        Throws:
        com.ibm.commerce.exception.ECSystemException
      • getCustomizedRoundMethod

        public int getCustomizedRoundMethod(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean,
                                            java.lang.String aUnit,
                                            java.lang.String aNumberUsage)
                                     throws com.ibm.commerce.exception.ECSystemException
        Get the rounding method used for a particular unit.
        Parameters:
        aStoreAccessBean - the store for which the rounding method applies.
        aUnit - the unit for which the rounding method applies.
        aNumberUsage - the number usage code.
        Returns:
        the rounding method.
        Throws:
        com.ibm.commerce.exception.ECSystemException
      • getCustomizedString

        public java.lang.String getCustomizedString(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean,
                                                    java.lang.String aUnit,
                                                    java.lang.Integer aLanguageId,
                                                    java.lang.String aNumberUsage)
                                             throws com.ibm.commerce.exception.ECSystemException
        Get the customized string from the format table.
        Parameters:
        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.
        Returns:
        the customized string from the format table.
        Throws:
        com.ibm.commerce.exception.ECSystemException
      • getDescription

        public java.lang.String getDescription(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean,
                                               java.lang.String aUnit,
                                               java.lang.Integer aLanguageId,
                                               java.lang.String aNumberUsage)
                                        throws com.ibm.commerce.exception.ECSystemException
        Get the description of the specified units.
        Parameters:
        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.
        Returns:
        the units description.
        Throws:
        com.ibm.commerce.exception.ECSystemException
      • getNumberOfDecimalPlaces

        public final int getNumberOfDecimalPlaces(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean,
                                                  java.lang.String aUnit,
                                                  java.lang.Integer aNumbrUsgId)
                                           throws com.ibm.commerce.exception.ECSystemException
        Get the number of decimal places for a particular unit.
        Parameters:
        aStoreAccessBean - the store that determines the number of decimal places.
        aUnit - the unit that determines the number of decimal places.
        aNumbrUsgId - the number usage id that determines the number of decimal places.
        Returns:
        the number of decimal places.
        Throws:
        com.ibm.commerce.exception.ECSystemException
      • getNumberOfDecimalPlaces

        public final int getNumberOfDecimalPlaces(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean,
                                                  java.lang.String aUnit,
                                                  java.lang.String aNumberUsage)
                                           throws com.ibm.commerce.exception.ECSystemException
        Get the number of decimal places for a particular unit.
        Parameters:
        aStoreAccessBean - the store that determines the number of decimal places.
        aUnit - the unit that determines the number of decimal places.
        aNumberUsage - the number usage code that determines the number of decimal places.
        Returns:
        the number of decimal places.
        Throws:
        com.ibm.commerce.exception.ECSystemException
      • getSymbol

        public java.lang.String getSymbol(com.ibm.commerce.common.objects.StoreAccessBean aStoreAccessBean,
                                          java.lang.String aUnit,
                                          java.lang.Integer aLanguageId,
                                          java.lang.String aNumberUsage)
                                   throws com.ibm.commerce.exception.ECSystemException
        Get the symbol information from the format table.
        Parameters:
        aStoreAccessBean - the store.
        aUnit - the unit.
        aLanguageId - the language Id of the language for the symbol.
        aNumberUsage - the number usage code.
        Returns:
        the symbol.
        Throws:
        com.ibm.commerce.exception.ECSystemException
      • isRefreshRequired

        public boolean isRefreshRequired()
        Returns true if the registry needs to be refreshed before it can be used.
        Returns:
        true if the registry needs to be refreshed before it can be used.
      • refresh

        public void refresh()
                     throws com.ibm.commerce.exception.ECSystemException
        Refresh the manager cache.
        Specified by:
        refresh in interface com.ibm.commerce.registry.Registry
        Throws:
        com.ibm.commerce.exception.ECSystemException
      • setRefreshRequired

        public void setRefreshRequired()
        Sets the refreshRequired property to true, indicating that the registry must be refreshed before it can be used.