net.sf.ehcache.store
Class LruPolicy
java.lang.Object
net.sf.ehcache.store.AbstractPolicy
net.sf.ehcache.store.LruPolicy
- All Implemented Interfaces:
- Policy
public class LruPolicy
- extends AbstractPolicy
Contains common LFU policy code for use between the LfuMemoryStore and the DiskStore, which also
uses an LfuPolicy for evictions.
- Version:
- $Id: LruPolicy.java 5594 2012-05-07 16:04:31Z cdennis $
- Author:
- Greg Luck
Field Summary |
static String |
NAME
The name of this policy as a string literal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
public static final String NAME
- The name of this policy as a string literal
- See Also:
- Constant Field Values
LruPolicy
public LruPolicy()
getName
public String getName()
- Returns:
- the name of the Policy. Inbuilt examples are LRU, LFU and FIFO.
compare
public boolean compare(Element element1,
Element element2)
- Compares the desirableness for eviction of two elements
Compares hit counts. If both zero,
- Parameters:
element1
- the element to compare againstelement2
- the element to compare
- Returns:
- true if the second element is preferable to the first element for ths policy
Copyright 2001-2015, Terracotta, Inc.