net.dontdrinkandroot.cache.expungestrategy.impl
Class AbstractMaxSizeExpungeStrategy
java.lang.Object
net.dontdrinkandroot.cache.expungestrategy.impl.AbstractMaxSizeExpungeStrategy
- All Implemented Interfaces:
- ExpungeStrategy
- Direct Known Subclasses:
- AbstractOneOverMaxSizeExpungeStrategy, AbstractRecyclingExpungeStrategy
public abstract class AbstractMaxSizeExpungeStrategy
- extends Object
- implements ExpungeStrategy
An ExpungeStrategy that selects all expired entries and entries according to the
implementation so that after those entries have been expunged the cache size is not larger that
the given max size.
- Author:
- Philip W. Sorst
|
Field Summary |
protected int |
maxSize
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
maxSize
protected int maxSize
AbstractMaxSizeExpungeStrategy
public AbstractMaxSizeExpungeStrategy(int maxSize)
- Constructs a new
AbstractMaxSizeExpungeStrategy with the given max size.
getMaxSize
public int getMaxSize()
- Get the current max size of this strategy.
getToExpungeMetaData
public <K,M extends MetaData> Collection<Map.Entry<K,M>> getToExpungeMetaData(Set<Map.Entry<K,M>> entrySet)
- Description copied from interface:
ExpungeStrategy
- Returns a collection of entries that should be expunged according to this strategy.
- Specified by:
getToExpungeMetaData in interface ExpungeStrategy
setMaxSize
public void setMaxSize(int maxSize)
- Set the max size of this strategy.
getComparator
protected abstract <K,M extends MetaData> Comparator<Map.Entry<K,M>> getComparator()
Copyright © 2013 dontdrinkandroot. All Rights Reserved.