org.apache.fop.fo.properties

Class PropertyCache


public class PropertyCache
extends java.lang.Object

Thin wrapper around a HashMap to implement the property caching idiom in which a new Property instance is created then tested against cached instances created previously. If an existing property is found, this is retained and the newly created one is instantly eligible for garbage collection.

Method Summary

Property
fetch(Property prop)
Checks if the given property is present in the cache - if so, returns a reference to the cached value.

Method Details

fetch

public Property fetch(Property prop)
Checks if the given property is present in the cache - if so, returns a reference to the cached value. Otherwise the given object is added to the cache and returned.
Parameters:
Returns:
the cached instance

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