ehcache

net.sf.ehcache.store
Class MemoryStoreEvictionPolicy

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

public final class MemoryStoreEvictionPolicy
extends Object
implements 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 5594 2012-05-07 16:04:31Z cdennis $
Author:
Greg Luck
See Also:
Serialized Form

Nested Class Summary
static class MemoryStoreEvictionPolicy.MemoryStoreEvictionPolicyEnum
          Enum for MemoryStoreEvictionPolicy
 
Field Summary
static MemoryStoreEvictionPolicy CLOCK
          FIFO - first in first out, the oldest element by creation time.
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(String policy)
          Converts a string representation of the policy into a policy.
 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.


CLOCK

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

Method Detail

toString

public String toString()
Overrides:
toString in class Object
Returns:
a String representation of the policy

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

ehcache

Copyright 2001-2014, Terracotta, Inc.