public class URLImageCache extends SoftReferenceCache
Adding an image is two fold. First you add the ParsedURL, this lets the cache know that someone is working on this ParsedURL. Then when the completed RenderedImage is ready you put it into the cache.
If someone requests a ParsedURL after it has been added but before it has been put they will be blocked until the put.
map
Constructor and Description |
---|
URLImageCache()
Let people create there own caches.
|
Modifier and Type | Method and Description |
---|---|
void |
clear(ParsedURL purl)
Clear the entry for ParsedURL.
|
static URLImageCache |
getDefaultCache() |
boolean |
isDone(ParsedURL purl)
Check if
request(url) will return immediately with the
Filter. |
boolean |
isPresent(ParsedURL purl)
Check if
request(url) will return with a Filter
(not putting you on the hook for it). |
void |
put(ParsedURL purl,
Filter filt)
Associate bi with purl.
|
Filter |
request(ParsedURL purl)
If this returns null then you are now 'on the hook'.
|
clearImpl, flush, isDoneImpl, isPresentImpl, putImpl, requestImpl
public static URLImageCache getDefaultCache()
public boolean isPresent(ParsedURL purl)
request(url)
will return with a Filter
(not putting you on the hook for it). Note that it is possible
that this will return true but between this call and the call
to request the soft-reference will be cleared. So it
is still possible for request to return NULL, just much less
likely (you can always call 'clear' in that case).public boolean isDone(ParsedURL purl)
request(url)
will return immediately with the
Filter. Note that it is possible that this will return
true but between this call and the call to request the
soft-reference will be cleared.public Filter request(ParsedURL purl)
public void clear(ParsedURL purl)
public void put(ParsedURL purl, Filter filt)
Copyright © 2022 Apache Software Foundation. All Rights Reserved.