|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.elca.el4j.services.statistics.detailed.cache.LRUCache<K,E>
K - Generic type of Key.E - Generic type of Element.public class LRUCache<K,E>
This class is a simple, generic FIFO Cache restricted to a certain size.
| Constructor Summary | |
|---|---|
LRUCache(int cacheSize)
Creates a new LRU cache. |
|
| Method Summary | |
|---|---|
void |
clear()
Clear the cache. |
E |
get(K key)
Get element out of cache. |
Collection<E> |
getAll()
Get all elements of cache. |
Set<K> |
getKeys()
Get all keys of bag. |
void |
put(K key,
E element)
Put element to cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LRUCache(int cacheSize)
cacheSize - the maximum number of entries that will be kept in this cache.| Method Detail |
|---|
public void put(K key,
E element)
key - Key of elementelement - Element to addpublic E get(K key)
key - Key of the element to get
public Collection<E> getAll()
public Set<K> getKeys()
public void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||