Package net.sf.ehcache.store
Class MemoryStoreEvictionPolicy
- java.lang.Object
-
- net.sf.ehcache.store.MemoryStoreEvictionPolicy
-
- All Implemented Interfaces:
java.io.Serializable
public final class MemoryStoreEvictionPolicy extends java.lang.Object implements java.io.SerializableA typesafe enumeration of eviction policies. The policy used to evict elements from theMemoryStore. This can be one of:- LRU - least recently used
- LFU - least frequently used
- FIFO - first in first out, the oldest element by creation time
- Since:
- 1.2
- Version:
- $Id$
- Author:
- Greg Luck
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMemoryStoreEvictionPolicy.MemoryStoreEvictionPolicyEnumEnum forMemoryStoreEvictionPolicy
-
Field Summary
Fields Modifier and Type Field Description static MemoryStoreEvictionPolicyCLOCKFIFO - first in first out, the oldest element by creation time.static MemoryStoreEvictionPolicyFIFOFIFO - first in first out, the oldest element by creation time.static MemoryStoreEvictionPolicyLFULFU - least frequently used.static MemoryStoreEvictionPolicyLRULRU - least recently used.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MemoryStoreEvictionPolicyfromString(java.lang.String policy)Converts a string representation of the policy into a policy.java.lang.StringtoString()
-
-
-
Field Detail
-
LRU
public static final MemoryStoreEvictionPolicy LRU
LRU - least recently used.
-
LFU
public static final MemoryStoreEvictionPolicy LFU
LFU - least frequently used.
-
FIFO
public static final MemoryStoreEvictionPolicy FIFO
FIFO - first in first out, the oldest element by creation time.
-
CLOCK
public static final MemoryStoreEvictionPolicy CLOCK
FIFO - first in first out, the oldest element by creation time.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a String representation of the policy
-
fromString
public static MemoryStoreEvictionPolicy fromString(java.lang.String policy)
Converts a string representation of the policy into a policy.- Parameters:
policy- either LRU, LFU or FIFO- Returns:
- one of the static instances
-
-