Package net.sf.ehcache.store
Class LfuPolicy
- java.lang.Object
-
- net.sf.ehcache.store.AbstractPolicy
-
- net.sf.ehcache.store.LfuPolicy
-
- All Implemented Interfaces:
Policy
public class LfuPolicy extends AbstractPolicy
Contains common LFU policy code for use between the LfuMemoryStore and the DiskStore, which also uses an LfuPolicy for evictions.- Version:
- $Id$
- Author:
- Greg Luck
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAMEThe name of this policy as a string literal
-
Constructor Summary
Constructors Constructor Description LfuPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancompare(Element element1, Element element2)Compares the desirableness for eviction of two elements Compares hit counts.java.lang.StringgetName()-
Methods inherited from class net.sf.ehcache.store.AbstractPolicy
calculateSampleSize, generateRandomSample, selectedBasedOnPolicy
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
The name of this policy as a string literal- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public java.lang.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
-
-