public abstract class AbstractIndexedCache<T>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractIndexedCache.Entry |
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_INITIAL_CAPACITY |
protected static float |
DEFAULT_LOAD_FACTOR |
protected AbstractIndexedCache.Entry[] |
entries |
protected int |
initialCapacity |
protected static int |
MAXIMUM_CAPACITY |
protected int |
size |
protected int |
threshold |
| Constructor and Description |
|---|
AbstractIndexedCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
protected void |
init(int capacity) |
abstract int |
putIfAbsent(T key) |
protected int |
resize(int newCapacity) |
protected static int |
roundUpToPowerOf2(int number) |
int |
size() |
protected static final int MAXIMUM_CAPACITY
protected static final int DEFAULT_INITIAL_CAPACITY
protected static final float DEFAULT_LOAD_FACTOR
protected int initialCapacity
protected AbstractIndexedCache.Entry[] entries
protected int threshold
protected int size
protected final void init(int capacity)
public abstract int putIfAbsent(T key)
public final int size()
public final void clear()
protected final int resize(int newCapacity)
protected static int roundUpToPowerOf2(int number)