Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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
`PropertyCache()` Creates a new cache.

Method Summary
`T` | `fetch(T obj)` Returns a cached version of the given object.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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 the `fetch(Object)` method will simply return its argument. To enable the cache, set this property to "true" (case insensitive).

Method Detail

### fetch

    public T fetch(T obj)

  Returns a cached version of the given object. If the object is not yet in the cache, it will be added and then returned.

  Parameters:
    `obj` - an object
  Returns:
    a cached version of the object

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.