Package org.apache.pdfbox.pdmodel
Class DefaultResourceCache
java.lang.Object
org.apache.pdfbox.pdmodel.DefaultResourceCache
- All Implemented Interfaces:
ResourceCache
A resource cached based on SoftReference, retains resources until memory pressure causes them
to be garbage collected.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<COSObject, SoftReference<PDColorSpace>> private final Map<COSObject, SoftReference<PDExtendedGraphicsState>> private final Map<COSObject, SoftReference<PDFont>> private final Map<COSObject, SoftReference<PDAbstractPattern>> private final Map<COSObject, SoftReference<PDPropertyList>> private final Map<COSObject, SoftReference<PDShading>> private final Map<COSObject, SoftReference<PDXObject>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetColorSpace(COSObject indirect) Returns the color space resource for the given indirect object, if it is in the cache.getExtGState(COSObject indirect) Returns the extended graphics state resource for the given indirect object, if it is in the cache.Returns the font resource for the given indirect object, if it is in the cache.getPattern(COSObject indirect) Returns the pattern resource for the given indirect object, if it is in the cache.getProperties(COSObject indirect) Returns the property list resource for the given indirect object, if it is in the cache.getShading(COSObject indirect) Returns the shading resource for the given indirect object, if it is in the cache.getXObject(COSObject indirect) Returns the XObject resource for the given indirect object, if it is in the cache.voidput(COSObject indirect, PDPropertyList propertyList) Puts the given indirect property list resource in the cache.voidPuts the given indirect font resource in the cache.voidput(COSObject indirect, PDColorSpace colorSpace) Puts the given indirect color space resource in the cache.voidput(COSObject indirect, PDAbstractPattern pattern) Puts the given indirect pattern resource in the cache.voidPuts the given indirect XObject resource in the cache.voidPuts the given indirect shading resource in the cache.voidput(COSObject indirect, PDExtendedGraphicsState extGState) Puts the given indirect extended graphics state resource in the cache.
-
Field Details
-
fonts
-
colorSpaces
-
xobjects
-
extGStates
-
shadings
-
patterns
-
properties
-
-
Constructor Details
-
DefaultResourceCache
public DefaultResourceCache()
-
-
Method Details
-
getFont
Description copied from interface:ResourceCacheReturns the font resource for the given indirect object, if it is in the cache.- Specified by:
getFontin interfaceResourceCache- Parameters:
indirect- the indirect reference of the font to be returned- Returns:
- the cached instance of the referenced font, if available
-
put
Description copied from interface:ResourceCachePuts the given indirect font resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect reference of the font to be cachedfont- the font to be cached
-
getColorSpace
Description copied from interface:ResourceCacheReturns the color space resource for the given indirect object, if it is in the cache.- Specified by:
getColorSpacein interfaceResourceCache- Parameters:
indirect- the indirect reference of the colorspace to be returned- Returns:
- the cached instance of the referenced colorspace, if available
-
put
Description copied from interface:ResourceCachePuts the given indirect color space resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect reference of the colorspace to be cachedcolorSpace- the colorspace to be cached
-
getExtGState
Description copied from interface:ResourceCacheReturns the extended graphics state resource for the given indirect object, if it is in the cache.- Specified by:
getExtGStatein interfaceResourceCache- Parameters:
indirect- the indirect reference of the extended graphics state to be returned- Returns:
- the cached instance of the referenced extended graphics state, if available
-
put
Description copied from interface:ResourceCachePuts the given indirect extended graphics state resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect reference of the extended graphics state to be cachedextGState- the extended graphics state to be cached
-
getShading
Description copied from interface:ResourceCacheReturns the shading resource for the given indirect object, if it is in the cache.- Specified by:
getShadingin interfaceResourceCache- Parameters:
indirect- the indirect reference of the shading to be returned- Returns:
- the cached instance of the referenced shading, if available
-
put
Description copied from interface:ResourceCachePuts the given indirect shading resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect reference of the shading to be cachedshading- the shading to be cached
-
getPattern
Description copied from interface:ResourceCacheReturns the pattern resource for the given indirect object, if it is in the cache.- Specified by:
getPatternin interfaceResourceCache- Parameters:
indirect- the indirect reference of the pattern to be returned- Returns:
- the cached instance of the referenced pattern, if available
-
put
Description copied from interface:ResourceCachePuts the given indirect pattern resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect reference of the pattern to be cachedpattern- the pattern to be cached
-
getProperties
Description copied from interface:ResourceCacheReturns the property list resource for the given indirect object, if it is in the cache.- Specified by:
getPropertiesin interfaceResourceCache- Parameters:
indirect- the indirect reference of the property list to be returned- Returns:
- the cached instance of the referenced property list, if available
-
put
Description copied from interface:ResourceCachePuts the given indirect property list resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect reference of the property list to be cachedpropertyList- the property list to be cached
-
getXObject
Description copied from interface:ResourceCacheReturns the XObject resource for the given indirect object, if it is in the cache.- Specified by:
getXObjectin interfaceResourceCache- Parameters:
indirect- the indirect reference of the XObject to be returned- Returns:
- the cached instance of the referenced XObject, if available
-
put
Description copied from interface:ResourceCachePuts the given indirect XObject resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect reference of the XObject to be cachedxobject- the XObject to be cached
-