| Modifier and Type | Field and Description |
|---|---|
| private final LRUMap | |
| private final Cache. | |
| private final ReentrantLock |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public V | Returns: the value from cache if exists, otherwise the newly created and saved valuethe key key)get from cache if exists else init the value + save in cache + return created value |
| public V |
| cache | back to summary |
|---|---|
| private final LRUMap<K, V> cache | |
| factory | back to summary |
|---|---|
| private final Cache. | |
| lock | back to summary |
|---|---|
| private final ReentrantLock lock | |
| LRUCache | back to summary |
|---|---|
| public LRUCache(Cache. | |
| clear | back to summary |
|---|---|
| public void clear() clear the cache | |
| get | back to summary |
|---|---|
| public V get(K key) get from cache if exists else init the value + save in cache + return created value
| |
| remove | back to summary |
|---|---|
| public V remove(final K key) remove an element identified by the passed key from the cache | |