public abstract class Cache<K,V> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected LinkedHashMap<K,Item<V>> |
items |
protected int |
maxSize |
| Constructor and Description |
|---|
Cache(int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(K key,
V value,
long created,
long duration) |
long |
addedBytes() |
protected abstract void |
entryToString(K key,
V value,
StringBuilder builder) |
int |
getMaxSize() |
int |
gets() |
int |
items() |
V |
lookup(K key) |
int |
misses() |
V |
probe(K key)
lookup without stats
|
long |
removedBytes() |
void |
resize(int max) |
int |
size() |
String |
toString() |
void |
validate() |
abstract int |
valueSize(V value) |
protected final LinkedHashMap<K,Item<V>> items
protected final int maxSize
public int getMaxSize()
public abstract int valueSize(V value)
public void resize(int max)
public int items()
public int size()
public int misses()
public int gets()
public long addedBytes()
public long removedBytes()
public void validate()
protected abstract void entryToString(K key, V value, StringBuilder builder)
Copyright © 2004–2017 1&1. All rights reserved.