|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ehcache.store.AbstractPolicy
public abstract class AbstractPolicy
A base policy class
Constructor Summary | |
---|---|
AbstractPolicy()
|
Method Summary | |
---|---|
static int |
calculateSampleSize(int populationSize)
sampleSize how many samples to take |
static int[] |
generateRandomSample(int populationSize)
Generates a random sample from a population |
Element |
selectedBasedOnPolicy(Element[] sampledElements,
Element justAdded)
Finds the best eviction candidate based on the sampled elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.ehcache.store.Policy |
---|
compare, getName |
Constructor Detail |
---|
public AbstractPolicy()
Method Detail |
---|
public static int calculateSampleSize(int populationSize)
populationSize
- the size of the store
public Element selectedBasedOnPolicy(Element[] sampledElements, Element justAdded)
selectedBasedOnPolicy
in interface Policy
sampledElements
- this should be a random subset of the populationjustAdded
- we never want to select the element just added. May be null.
public static int[] generateRandomSample(int populationSize)
populationSize
- the size to draw from
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |