org.apache.batik.ext.awt.color
Class NamedProfileCache
public
class
NamedProfileCache
extends SoftReferenceCache
This class manages a cache of soft references to named profiles that
we have already loaded.
Method Summary |
void | clear(String profileName)
Clear the entry for String.
|
static NamedProfileCache | getDefaultCache() |
boolean | isDone(String profileName)
Check if request(profileName) will return immediately with the
ICCColorSpaceExt. |
boolean | isPresent(String profileName)
Check if request(profileName) will return with a ICCColorSpaceExt
(not putting you on the hook for it). |
void | put(String profileName, ICCColorSpaceExt bi)
Associate bi with profileName. bi is only referenced through
a soft reference so don't rely on the cache to keep it
around. |
ICCColorSpaceExt | request(String profileName)
If this returns null then you are now 'on the hook'.
to put the ICCColorSpaceExt associated with String into the
cache. |
public NamedProfileCache()
Let people create there own caches.
public void clear(String profileName)
Clear the entry for String.
This is the easiest way to 'get off the hook'.
if you didn't indend to get on it.
public boolean isDone(String profileName)
Check if request(profileName) will return immediately with the
ICCColorSpaceExt. 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 boolean isPresent(String profileName)
Check if request(profileName) will return with a ICCColorSpaceExt
(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).
Associate bi with profileName. bi is only referenced through
a soft reference so don't rely on the cache to keep it
around. If the map no longer contains our profileName it was
probably cleared or flushed since we were put on the hook
for it, so in that case we will do nothing.
If this returns null then you are now 'on the hook'.
to put the ICCColorSpaceExt associated with String into the
cache.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.