|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.refimpl.gvt.filter.URLImageCache
This class manages a cache of soft references to Images that we have already loaded. Adding an image is two fold. First you add the URL, this lets the cache know that someone is working on this URL. Then when the completed BufferedImage is ready you put it into the cache.
If someone requests a URL after it has been added but before it has been put they will be blocked until the put.
Constructor Summary | |
URLImageCache()
Let people create there own caches. |
Method Summary | |
void |
clear(java.net.URL url)
Clear the entry for URL. |
static URLImageCache |
getDefaultCache()
|
boolean |
isDone(java.net.URL url)
Check if request(url) will return immediately with the BufferedImage. |
boolean |
isPresent(java.net.URL url)
Check if request(url) will return with a BufferedImage (not putting you on the hook for it). |
void |
put(java.net.URL url,
java.awt.image.BufferedImage bi)
Associate bi with url. |
java.awt.image.BufferedImage |
request(java.net.URL url)
If this returns null then you are now 'on the hook'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public URLImageCache()
Method Detail |
public static URLImageCache getDefaultCache()
public boolean isPresent(java.net.URL url)
public boolean isDone(java.net.URL url)
public java.awt.image.BufferedImage request(java.net.URL url)
public void clear(java.net.URL url)
public void put(java.net.URL url, java.awt.image.BufferedImage bi)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |