Package org.apache.fop.fo.properties
Class PropertyCache<T>
- java.lang.Object
-
- org.apache.fop.fo.properties.PropertyCache<T>
-
- Type Parameters:
T
- The type of values that are cached
public final class PropertyCache<T> extends java.lang.Object
Thread-safe cache that minimizes the memory requirements by fetching an instance from the cache that is equal to the given one. Internally the instances are stored in WeakReferences in order to be reclaimed when they are no longer referenced.
-
-
Constructor Summary
Constructors Constructor Description PropertyCache()
Creates a new cache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
fetch(T obj)
Returns a cached version of the given object.
-
-
-
Constructor Detail
-
PropertyCache
public PropertyCache()
Creates a new cache. The "org.apache.fop.fo.properties.use-cache" system property is used to determine whether properties should actually be cached or not. If not, then thefetch(Object)
method will simply return its argument. To enable the cache, set this property to "true" (case insensitive).
-
-