public class MaxCacheSizePolicy<K,V> extends Object implements RetentionPolicy
Created by Jeff Gaynor
on Nov 12, 2010 at 9:51:36 AM
Constructor and Description |
---|
MaxCacheSizePolicy(Map<K,V> cache,
int maxCacheSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
applies()
If this applies to the current cache.
|
Map<K,V> |
getMap()
The cache to which this policy is applied.
|
int |
getMaximumSize() |
boolean |
retain(Object key,
Object value) |
void |
setMap(Map<K,V> map) |
void |
setMaximumSize(int maximumSize) |
protected boolean |
sizeOk()
Returns true if the size of the cache is ok.
|
public Map<K,V> getMap()
RetentionPolicy
getMap
in interface RetentionPolicy
public int getMaximumSize()
public void setMaximumSize(int maximumSize)
public boolean retain(Object key, Object value)
retain
in interface RetentionPolicy
public boolean applies()
RetentionPolicy
RetentionPolicy.retain(Object, Object)
method will be applied to each element of the cache. When false, this policy will be skipped.
applies
in interface RetentionPolicy
protected boolean sizeOk()
Copyright © 2019. All Rights Reserved.