com.ibm.commons.util
Class SystemCache

java.lang.Object
  extended by com.ibm.commons.util.SystemCache

public final class SystemCache
extends java.lang.Object

System cache using a LRU mechanism.

This cache is used to hold a certain number of entries that can be reused. For example, it can be used to cache compiled version of JavaScript snippets of code, or XPath definition.


Constructor Summary
SystemCache(java.lang.String name, int maxSize)
           
SystemCache(java.lang.String name, int maxSize, java.lang.String propertyName)
           
 
Method Summary
 void clear()
           
 java.lang.Object get(java.lang.String key)
           
 long getAccessedTimes()
           
 long getAddedTimes()
           
 int getCapacity()
           
 long getDiscardedTimes()
           
 long getInCacheTimes()
           
 java.lang.String getName()
           
 void put(java.lang.String key, java.lang.Object value)
           
 void remove(java.lang.String key)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemCache

public SystemCache(java.lang.String name,
                   int maxSize)

SystemCache

public SystemCache(java.lang.String name,
                   int maxSize,
                   java.lang.String propertyName)
Method Detail

getName

public java.lang.String getName()

getAccessedTimes

public long getAccessedTimes()

getInCacheTimes

public long getInCacheTimes()

getAddedTimes

public long getAddedTimes()

getDiscardedTimes

public long getDiscardedTimes()

size

public int size()

getCapacity

public int getCapacity()

clear

public void clear()

remove

public void remove(java.lang.String key)

get

public java.lang.Object get(java.lang.String key)

put

public void put(java.lang.String key,
                java.lang.Object value)