ehcache

net.sf.ehcache.store
Class MemoryStoreEvictionPolicy

java.lang.Object
  extended by net.sf.ehcache.store.MemoryStoreEvictionPolicy
All Implemented Interfaces:
java.io.Serializable

public final class MemoryStoreEvictionPolicy
extends java.lang.Object
implements java.io.Serializable

A typesafe enumeration of eviction policies. The policy used to evict elements from the MemoryStore. This can be one of:

  1. LRU - least recently used
  2. LFU - least frequently used
  3. FIFO - first in first out, the oldest element by creation time
The default value is LRU

Since:
1.2
Version:
$Id: MemoryStoreEvictionPolicy.java 519 2007-07-27 07:11:45Z gregluck $
Author:
Greg Luck
See Also:
Serialized Form

Field Summary
static MemoryStoreEvictionPolicy FIFO
          FIFO - first in first out, the oldest element by creation time.
static MemoryStoreEvictionPolicy LFU
          LFU - least frequently used.
static MemoryStoreEvictionPolicy LRU
          LRU - least recently used.
 
Method Summary
static MemoryStoreEvictionPolicy fromString(java.lang.String policy)
          Converts a string representation of the policy into a policy.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.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

ehcache