net.sf.ehcache.store

Class MemoryStoreEvictionPolicy

public final class MemoryStoreEvictionPolicy extends Object

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 52 2006-04-24 14:50:03Z gregluck $

Author: Greg Luck

Field Summary
static MemoryStoreEvictionPolicyFIFO
FIFO - first in first out, the oldest element by creation time.
static MemoryStoreEvictionPolicyLFU
LFU - least frequently used.
static MemoryStoreEvictionPolicyLRU
LRU - least recently used.
Method Summary
static MemoryStoreEvictionPolicyfromString(String policy)
Converts a string representation of the policy into a policy.
StringtoString()

Field Detail

FIFO

public static final MemoryStoreEvictionPolicy FIFO
FIFO - first in first out, the oldest element by creation time.

LFU

public static final MemoryStoreEvictionPolicy LFU
LFU - least frequently used.

LRU

public static final MemoryStoreEvictionPolicy LRU
LRU - least recently used.

Method Detail

fromString

public static MemoryStoreEvictionPolicy fromString(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

toString

public String toString()

Returns: a String representation of the policy