com.ibm.commerce.order.calculation
Class Cache

java.lang.Object
  |
  +--com.ibm.commerce.order.calculation.Cache
Direct Known Subclasses:
CodeCache, CodeMemberGroupRelationshipCache, IndirectAttachmentCache, LookupResultCache, MethodCache, RangeCache, RuleCache, RuleMemberGroupRelationshipCache, RuleScaleRelationshipCache, ScaleCache, ShippingRuleCache, StoreEntityUsageCache, TaxCategoryIdCache, TaxRuleCache, UsageSequenceCache

public abstract class Cache
extends java.lang.Object

Reserved for IBM internal use.
This cache implementation is backed by a HashMap and uses the LRU replacement algorithm.


Field Summary
static java.lang.String COPYRIGHT
           
static int DEFAULT_SIZE
           
 
Constructor Summary
Cache()
          Constructs a new cache with the default size of 200.
Cache(int anSize)
          Constructs a new cache.
 
Method Summary
 void clear()
          Clears the cache.
 java.lang.Object get(java.lang.Object aKey)
          Returns the value which the key is mapped to.
protected abstract  java.lang.Object miss(java.lang.Object aKey)
          This method is called by get() to identify the value which the key is mapped to when it is not stored in the HashMap.
 void setSize(int anSize)
          Sets the size of the cache.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT

DEFAULT_SIZE

public static final int DEFAULT_SIZE
Constructor Detail

Cache

public Cache()
Constructs a new cache with the default size of 200.

Cache

public Cache(int anSize)
Constructs a new cache.
Method Detail

clear

public void clear()
Clears the cache.

get

public java.lang.Object get(java.lang.Object aKey)
                     throws ECException
Returns the value which the key is mapped to.

miss

protected abstract java.lang.Object miss(java.lang.Object aKey)
                                  throws ECException
This method is called by get() to identify the value which the key is mapped to when it is not stored in the HashMap.

setSize

public void setSize(int anSize)
Sets the size of the cache.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object