|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectes.ucm.fdi.hysteria.gui.Cache<V,T>
V - The "key" objectT - The "requested" objectpublic class Cache<V,T>
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 | |
|---|---|
static interface |
Cache.Factory<T>
Abstract factory interface needed for "teaching" the class how to build a T object. |
| Constructor Summary | |
|---|---|
Cache(Cache.Factory<T> fact)
|
|
| Method Summary | |
|---|---|
T |
getFromCache(V v)
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 |
| Constructor Detail |
|---|
public Cache(Cache.Factory<T> fact)
| Method Detail |
|---|
public T getFromCache(V v)
v - The "key"
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||