T
- value type@ThreadSafe public final class FIFOCache<T> extends Object
Constructor and Description |
---|
FIFOCache(int maxSize) |
Modifier and Type | Method and Description |
---|---|
T |
add(String key,
T value)
Adds an entry to the cache, evicting the earliest entry if necessary.
|
T |
get(String key)
Returns the value of the given key; or null of no such entry exists.
|
int |
getMaxSize()
Returns the maximum size of the cache.
|
int |
size()
Returns the current size of the cache.
|
String |
toString() |
public FIFOCache(int maxSize)
maxSize
- the maximum number of entries of the cache