T
- the type of item to be kept in the cachepublic class Cache<T>
extends java.util.AbstractCollection<T>
Cache
class is a simple collection that maintains a list of
references to cached items, but does so weakly or softly, so that those
references may be released by the garbage collector depending on memory usage
and availability.
The constructor for this object is hidden, so in order to get an instance,
please use the inner Factory
class.
Modifier and Type | Class and Description |
---|---|
static class |
Cache.Factory
A
Cache instance may not be constructed directly. |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T e) |
void |
clear() |
java.util.Iterator<T> |
iterator() |
int |
size() |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString