public class ConcurrentLinkedHashCache<K extends IMeasurableMemory,V extends IMeasurableMemory> extends java.lang.Object implements ICache<K,V>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CONCURENCY_LEVEL |
| Modifier and Type | Method and Description |
|---|---|
long |
capacity() |
void |
clear() |
boolean |
containsKey(K key) |
static <K extends IMeasurableMemory,V extends IMeasurableMemory> |
create(long weightedCapacity) |
static <K extends IMeasurableMemory,V extends IMeasurableMemory> |
create(long weightedCapacity,
com.googlecode.concurrentlinkedhashmap.EntryWeigher<K,V> entryWeiger)
Initialize a cache with initial capacity with weightedCapacity
|
V |
get(K key) |
java.util.Iterator<K> |
hotKeyIterator(int n) |
boolean |
isEmpty() |
java.util.Iterator<K> |
keyIterator() |
void |
put(K key,
V value) |
boolean |
putIfAbsent(K key,
V value) |
void |
remove(K key) |
boolean |
replace(K key,
V old,
V value) |
void |
setCapacity(long capacity) |
int |
size() |
long |
weightedSize() |
public static final int DEFAULT_CONCURENCY_LEVEL
public static <K extends IMeasurableMemory,V extends IMeasurableMemory> ConcurrentLinkedHashCache<K,V> create(long weightedCapacity, com.googlecode.concurrentlinkedhashmap.EntryWeigher<K,V> entryWeiger)
public static <K extends IMeasurableMemory,V extends IMeasurableMemory> ConcurrentLinkedHashCache<K,V> create(long weightedCapacity)
public long capacity()
capacity in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public void setCapacity(long capacity)
setCapacity in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public boolean isEmpty()
public int size()
size in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public long weightedSize()
weightedSize in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public void clear()
clear in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public V get(K key)
get in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public void put(K key, V value)
put in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public boolean putIfAbsent(K key, V value)
putIfAbsent in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public boolean replace(K key, V old, V value)
replace in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public void remove(K key)
remove in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public java.util.Iterator<K> keyIterator()
keyIterator in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public java.util.Iterator<K> hotKeyIterator(int n)
hotKeyIterator in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>public boolean containsKey(K key)
containsKey in interface ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>Copyright © 2016 The Apache Software Foundation