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.
- Author:
- John Hewson
-
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.
-
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 object- Returns:
- the font resource of the given indirect object.
- Throws:
IOException- if something went wrong.
-
put
Description copied from interface:ResourceCachePuts the given indirect font resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect object of the resource.font- the font resource.- Throws:
IOException- if something went wrong.
-
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 object- Returns:
- the color space resource of the given indirect object.
- Throws:
IOException- if something went wrong.
-
put
Description copied from interface:ResourceCachePuts the given indirect color space resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect object of the resource.colorSpace- the color space resource.- Throws:
IOException- if something went wrong.
-
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 object- Returns:
- the extended graphics resource of the given indirect object.
-
put
Description copied from interface:ResourceCachePuts the given indirect extended graphics state resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect object of the resource.extGState- the extended graphics state resource.
-
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 object- Returns:
- the shading resource of the given indirect object.
- Throws:
IOException- if something went wrong.
-
put
Description copied from interface:ResourceCachePuts the given indirect shading resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect object of the resource.shading- the shading resource.- Throws:
IOException- if something went wrong.
-
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 object- Returns:
- the pattern resource of the given indirect object.
- Throws:
IOException- if something went wrong.
-
put
Description copied from interface:ResourceCachePuts the given indirect pattern resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect object of the resource.pattern- the pattern resource.- Throws:
IOException- if something went wrong.
-
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 object- Returns:
- the property list resource of the given indirect object.
-
put
Description copied from interface:ResourceCachePuts the given indirect property list resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect object of the resource.propertyList- the property list resource.
-
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 object- Returns:
- the XObject resource of the given indirect object.
- Throws:
IOException- if something went wrong.
-
put
Description copied from interface:ResourceCachePuts the given indirect XObject resource in the cache.- Specified by:
putin interfaceResourceCache- Parameters:
indirect- the indirect object of the resource.xobject- the XObject resource.- Throws:
IOException- if something went wrong.
-