com.ibm.commerce.order.calculation

Class Cache

  • java.lang.Object
    • com.ibm.commerce.order.calculation.Cache
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The IBM copyright notice fields.
      static int DEFAULT_MAX_SIZE
      The default maximum cache size.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Cache()
      Constructor for Cache, with a maximum size that defaults to
      Cache(int anMaxSize)
      Constructor for Cache.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      void clear()
      Clears the cache.
      java.lang.Object get(java.lang.Object aKey)
      Returns the value which the key is mapped to.
      static int getDefaultMaxSize(java.lang.String astrConfigName, int aDefaultMaxSize)
      Returns the configured default maximum size.
      int getMaxSize()
      Returns the maximum size of the cache.
      java.lang.Object remove(java.lang.Object aKey)
      Removes the value which the key is mapped to.
      void setMaxSize(int anMaxSize)
      Sets the maximum size of the cache.
      void setSize(int anMaxSize)
      Deprecated. 
      renamed to setMaxSize(int).
      java.lang.String toString()
      Returns the string representation of the cache for diagnostic purposes.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright notice fields.
        See Also:
        Constant Field Values
      • DEFAULT_MAX_SIZE

        public static final int DEFAULT_MAX_SIZE
        The default maximum cache size.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Cache

        public Cache()
        Constructor for Cache, with a maximum size that defaults to
        DEFAULT_MAX_SIZE
        .
      • Cache

        public Cache(int anMaxSize)
        Constructor for Cache.
        Parameters:
        anMaxSize - the maximum size of the cache.
    • Method Detail

      • getDefaultMaxSize

        public static int getDefaultMaxSize(java.lang.String astrConfigName,
                                            int aDefaultMaxSize)
        Returns the configured default maximum size.
        Parameters:
        astrConfigName - a unique identifier used to lookup the configured default maximum size. Normally, this is the class name of the caching class.
        aDefaultMaxSize - the default maximum size to use if none is configured.
        Returns:
        the configured default maximum size.
      • clear

        public void clear()
        Clears the cache.
      • remove

        public java.lang.Object remove(java.lang.Object aKey)
                                throws ECException
        Removes the value which the key is mapped to.
        Parameters:
        aKey - the key.
        Returns:
        the removed value.
        Throws:
        ECException
      • get

        public java.lang.Object get(java.lang.Object aKey)
                             throws ECException
        Returns the value which the key is mapped to.
        Parameters:
        aKey - the key.
        Returns:
        the value.
        Throws:
        ECException
      • getMaxSize

        public int getMaxSize()
        Returns the maximum size of the cache.
        Returns:
        the maximum size of the cache.
      • setMaxSize

        public void setMaxSize(int anMaxSize)
        Sets the maximum size of the cache.
        Parameters:
        anMaxSize - the maximum size of the cache.
      • setSize

        public void setSize(int anMaxSize)
        Deprecated. renamed to setMaxSize(int).
        Sets the maximum size of the cache.
        Parameters:
        anMaxSize - the maximum size of the cache.
      • toString

        public java.lang.String toString()
        Returns the string representation of the cache for diagnostic purposes.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation of the cache.