|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcreme.enumerations.Enumeration
org.jcreme.caches.CachePolicy
This Enumeration subclass describes the possible policies to manage the cache contents. Each member is a cache factory to be used by AggregateCache instances. Current implemented values are: NONE (this gives a HashCache): replacement is undefined. FIFO (this gives a FIFOCache): new elements push older ones. The oldest is removed. LUFO (this gives a LUFOCache): keep statistics on cache element usage. The least used element is removed. The policy choice for a cache depends heavily on the use of that cache.
Field Summary | |
static CachePolicy |
FIFO
The 'FIFO' enumeration value. |
static CachePolicy |
LUFO
The 'LUFO' enumeration value. |
static CachePolicy |
NONE
The 'NONE' enumeration value. |
static java.lang.String |
S_FIFO
The name for the 'FIFO' enumeration value. |
static java.lang.String |
S_LUFO
The name for the 'LUFO' enumeration value. |
static java.lang.String |
S_NONE
The name for the 'NONE' enumeration value. |
(package private) static long |
serialVersionUID
|
Constructor Summary | |
protected |
CachePolicy(java.lang.String name)
Creates new CachePolicy |
Method Summary | |
static CachePolicy |
get(java.lang.String name)
This method retrieves a CachePolicy instance from its name. |
BaseCache |
getCacheInstance()
This method provides a new cache that implements the policy. |
BaseCache |
getCacheInstance(int minSize,
int maxSize)
This method provides a new cache that implements the policy. |
static CachePolicy[] |
getCachePolicies()
This methods gives the instances of this class. |
protected java.util.Hashtable |
getFromName()
This method is for internal use only. |
static Enumeration[] |
getValues()
This method enables to retrieve all the possible values of an Enumeration class. |
Methods inherited from class org.jcreme.enumerations.Enumeration |
compareTo, getName, readResolve, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final long serialVersionUID
public static final java.lang.String S_FIFO
public static final CachePolicy FIFO
public static final java.lang.String S_LUFO
public static final CachePolicy LUFO
public static final java.lang.String S_NONE
public static final CachePolicy NONE
Constructor Detail |
protected CachePolicy(java.lang.String name)
name
- the name of this enumerated value. It cannot be null.
InvalidParameterException
- if one of the parameters is null.Method Detail |
protected java.util.Hashtable getFromName()
getFromName
in class Enumeration
public static CachePolicy get(java.lang.String name)
name
- the name of the CachePolicy instance.
public static CachePolicy[] getCachePolicies()
public BaseCache getCacheInstance(int minSize, int maxSize)
minSize
- the initial size of the cache.maxSize
- the maximum size of the created cache.
public BaseCache getCacheInstance()
public static Enumeration[] getValues()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |