|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.util.LRUCache<K,V>
public class LRUCache<K,V>
A Least Recently Used Cache
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
LRUCache(int maximumCacheSize)
|
|
LRUCache(int initialCapacity,
int maximumCacheSize)
Constructs an empty LRUCache instance with the specified initial capacity, maximumCacheSize,load factor and ordering mode. |
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(Object o)
|
boolean |
containsValue(Object o)
|
Set<Map.Entry<K,V>> |
entrySet()
|
V |
get(Object o)
|
long |
getHits()
Gets the number of cache hits |
int |
getMaxCacheSize()
Returns the maxCacheSize. |
long |
getMisses()
Gets the number of cache misses. |
boolean |
isEmpty()
|
Set<K> |
keySet()
|
V |
put(K k,
V v)
|
void |
putAll(Map<? extends K,? extends V> map)
|
V |
remove(Object o)
|
void |
resetStatistics()
Rest the cache statistics such as hits and misses. |
int |
size()
|
String |
toString()
|
Collection<V> |
values()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public LRUCache(int maximumCacheSize)
public LRUCache(int initialCapacity,
int maximumCacheSize)
initialCapacity - the initial capacity.maximumCacheSize - the max capacity.
IllegalArgumentException - if the initial capacity is negative
or the load factor is non positive.| Method Detail |
|---|
public V get(Object o)
get in interface Map<K,V>public int size()
size in interface Map<K,V>public boolean isEmpty()
isEmpty in interface Map<K,V>public boolean containsKey(Object o)
containsKey in interface Map<K,V>public boolean containsValue(Object o)
containsValue in interface Map<K,V>
public V put(K k,
V v)
put in interface Map<K,V>public V remove(Object o)
remove in interface Map<K,V>public void putAll(Map<? extends K,? extends V> map)
putAll in interface Map<K,V>public void clear()
clear in interface Map<K,V>public Set<K> keySet()
keySet in interface Map<K,V>public Collection<V> values()
values in interface Map<K,V>public Set<Map.Entry<K,V>> entrySet()
entrySet in interface Map<K,V>public long getHits()
public long getMisses()
public int getMaxCacheSize()
public void resetStatistics()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||