|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.utils.CachedGrabber<O,G>
public class CachedGrabber<O,G>
INTERNAL: Grabber that maintains a cache of previously grabbed objects. It works with any implementation of GrabberIF.
The cache is first checked to see if a grabbed version already exists. Otherwise the object is grabbed and the cache is updated. If the underlying grabber is modified or replaced, the cache is not refreshed automatically. This has to be done explicitly.
Field Summary | |
---|---|
protected java.util.Map<O,G> |
cache
|
protected GrabberIF<O,G> |
grabber
|
Constructor Summary | |
---|---|
CachedGrabber(GrabberIF<O,G> grabber)
|
Method Summary | |
---|---|
GrabberIF<O,G> |
getGrabber()
Gets the grabber that is being cached. |
G |
grab(O object)
Returns an object that is somehow extracted from the given object. |
void |
refresh()
Refreshes the cache. |
void |
setGrabber(GrabberIF<O,G> grabber)
Sets the grabber that is to be cached. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected GrabberIF<O,G> grabber
protected java.util.Map<O,G> cache
Constructor Detail |
---|
public CachedGrabber(GrabberIF<O,G> grabber)
Method Detail |
---|
public GrabberIF<O,G> getGrabber()
public void setGrabber(GrabberIF<O,G> grabber)
public G grab(O object)
GrabberIF
grab
in interface GrabberIF<O,G>
public void refresh()
CachedIF
refresh
in interface CachedIF
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |