|
||||||||||
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 |
---|
java.util.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(java.lang.Object o)
|
boolean |
containsValue(java.lang.Object o)
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
|
V |
get(java.lang.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()
|
java.util.Set<K> |
keySet()
|
V |
put(K k,
V v)
|
void |
putAll(java.util.Map<? extends K,? extends V> map)
|
V |
remove(java.lang.Object o)
|
void |
resetStatistics()
Rest the cache statistics such as hits and misses. |
int |
size()
|
java.lang.String |
toString()
|
java.util.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.
java.lang.IllegalArgumentException
- if the initial capacity is negative
or the load factor is non positive.Method Detail |
---|
public V get(java.lang.Object o)
get
in interface java.util.Map<K,V>
public int size()
size
in interface java.util.Map<K,V>
public boolean isEmpty()
isEmpty
in interface java.util.Map<K,V>
public boolean containsKey(java.lang.Object o)
containsKey
in interface java.util.Map<K,V>
public boolean containsValue(java.lang.Object o)
containsValue
in interface java.util.Map<K,V>
public V put(K k, V v)
put
in interface java.util.Map<K,V>
public V remove(java.lang.Object o)
remove
in interface java.util.Map<K,V>
public void putAll(java.util.Map<? extends K,? extends V> map)
putAll
in interface java.util.Map<K,V>
public void clear()
clear
in interface java.util.Map<K,V>
public java.util.Set<K> keySet()
keySet
in interface java.util.Map<K,V>
public java.util.Collection<V> values()
values
in interface java.util.Map<K,V>
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
entrySet
in interface java.util.Map<K,V>
public long getHits()
public long getMisses()
public int getMaxCacheSize()
public void resetStatistics()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |