- Type Parameters:
V - The "key" object
T - The "requested" object
public class Cache<V,T>
- extends java.lang.Object
This class wraps a Hashtable. It works as a cache. If a given T object is requested by a given
V object, if it's not already in the Hashtable (A.k.a. already loaded before), it's created and
added to the Hashtable
Nested Class Summary
Abstract factory interface needed for "teaching" the class how to build a T object.
This method "asks" the cache if a given Object was already created/loaded.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Cache(Cache.Factory<T> fact)
public T getFromCache(V v)
- This method "asks" the cache if a given Object was already created/loaded. If it's not, then
it creates the Object, and adds to the structure.
v - The "key"
- The Object