Package org.apache.batik.ext.awt.color
Class NamedProfileCache
java.lang.Object
org.apache.batik.util.SoftReferenceCache
org.apache.batik.ext.awt.color.NamedProfileCache
This class manages a cache of soft references to named profiles that
we have already loaded.
-
Field Summary
Fields inherited from class org.apache.batik.util.SoftReferenceCache
map
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the entry for String.static NamedProfileCache
boolean
Check ifrequest(profileName)
will return immediately with the ICCColorSpaceExt.boolean
Check ifrequest(profileName)
will return with a ICCColorSpaceExt (not putting you on the hook for it).void
Associate bi with profileName.org.apache.xmlgraphics.java2d.color.ICCColorSpaceWithIntent
If this returns null then you are now 'on the hook'.Methods inherited from class org.apache.batik.util.SoftReferenceCache
clearImpl, flush, isDoneImpl, isPresentImpl, putImpl, requestImpl
-
Constructor Details
-
NamedProfileCache
public NamedProfileCache()Let people create there own caches.
-
-
Method Details
-
getDefaultCache
-
isPresent
Check ifrequest(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). -
isDone
Check ifrequest(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. -
request
If this returns null then you are now 'on the hook'. to put the ICCColorSpaceExt associated with String into the cache.- Parameters:
profileName
- the profile name
-
clear
Clear the entry for String. This is the easiest way to 'get off the hook'. if you didn't indend to get on it. -
put
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.
-