org.apache.fop.fo.properties

Class PropertyCache


public final class PropertyCache
extends java.lang.Object

Dedicated cache, meant for storing canonical instances of property-related classes. The public access points are overloaded fetch() methods that each correspond to a cached type. It is designed especially to be used concurrently by multiple threads, drawing heavily upon the principles behind Java 1.5's ConcurrentHashMap.

Constructor Summary

PropertyCache()
Default constructor.

Method Summary

CommonFont
fetch(CommonFont cf)
Checks if the given CommonFont is present in the cache - if so, returns a reference to the cached instance.
CommonFont.CachedCommonFont
fetch(CommonFont.CachedCommonFont ccf)
Checks if the given CachedCommonFont is present in the cache - if so, returns a reference to the cached instance.
CommonHyphenation
fetch(CommonHyphenation chy)
Checks if the given CommonHyphenation is present in the cache - if so, returns a reference to the cached instance.
Property
fetch(Property prop)
Checks if the given Property is present in the cache - if so, returns a reference to the cached instance.

Constructor Details

PropertyCache

public PropertyCache()
Default constructor.

Method Details

fetch

public final CommonFont fetch(CommonFont cf)
Checks if the given CommonFont is present in the cache - if so, returns a reference to the cached instance. Otherwise the given object is added to the cache and returned.
Parameters:
cf - the CommonFont instance to check for
Returns:
the cached instance

fetch

public final CommonFont.CachedCommonFont fetch(CommonFont.CachedCommonFont ccf)
Checks if the given CachedCommonFont is present in the cache - if so, returns a reference to the cached instance. Otherwise the given object is added to the cache and returned.
Parameters:
ccf - the CachedCommonFont instance to check for
Returns:
the cached instance

fetch

public final CommonHyphenation fetch(CommonHyphenation chy)
Checks if the given CommonHyphenation is present in the cache - if so, returns a reference to the cached instance. Otherwise the given object is added to the cache and returned.
Parameters:
chy - the CommonHyphenation instance to check for
Returns:
the cached instance

fetch

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

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