public class DefaultResourceCache extends java.lang.Object implements ResourceCache
Modifier and Type | Field and Description |
---|---|
private java.util.Map<COSObject,java.lang.ref.SoftReference<PDColorSpace>> |
colorSpaces |
private java.util.Map<COSObject,java.lang.ref.SoftReference<PDExtendedGraphicsState>> |
extGStates |
private java.util.Map<COSObject,java.lang.ref.SoftReference<PDFont>> |
fonts |
private java.util.Map<COSObject,java.lang.ref.SoftReference<PDAbstractPattern>> |
patterns |
private java.util.Map<COSObject,java.lang.ref.SoftReference<PDPropertyList>> |
properties |
private java.util.Map<COSObject,java.lang.ref.SoftReference<PDShading>> |
shadings |
private java.util.Map<COSObject,java.lang.ref.SoftReference<PDXObject>> |
xobjects |
Constructor and Description |
---|
DefaultResourceCache() |
Modifier and Type | Method and Description |
---|---|
PDColorSpace |
getColorSpace(COSObject indirect)
Returns the color space resource for the given indirect object, if it is in the cache.
|
PDExtendedGraphicsState |
getExtGState(COSObject indirect)
Returns the extended graphics state resource for the given indirect object, if it is in the cache.
|
PDFont |
getFont(COSObject indirect)
Returns the font resource for the given indirect object, if it is in the cache.
|
PDAbstractPattern |
getPattern(COSObject indirect)
Returns the pattern resource for the given indirect object, if it is in the cache.
|
PDPropertyList |
getProperties(COSObject indirect)
Returns the property list resource for the given indirect object, if it is in the cache.
|
PDShading |
getShading(COSObject indirect)
Returns the shading resource for the given indirect object, if it is in the cache.
|
PDXObject |
getXObject(COSObject indirect)
Returns the XObject resource for the given indirect object, if it is in the cache.
|
void |
put(COSObject indirect,
PDAbstractPattern pattern)
Puts the given indirect pattern resource in the cache.
|
void |
put(COSObject indirect,
PDColorSpace colorSpace)
Puts the given indirect color space resource in the cache.
|
void |
put(COSObject indirect,
PDExtendedGraphicsState extGState)
Puts the given indirect extended graphics state resource in the cache.
|
void |
put(COSObject indirect,
PDFont font)
Puts the given indirect font resource in the cache.
|
void |
put(COSObject indirect,
PDPropertyList propertyList)
Puts the given indirect property list resource in the cache.
|
void |
put(COSObject indirect,
PDShading shading)
Puts the given indirect shading resource in the cache.
|
void |
put(COSObject indirect,
PDXObject xobject)
Puts the given indirect XObject resource in the cache.
|
private final java.util.Map<COSObject,java.lang.ref.SoftReference<PDColorSpace>> colorSpaces
private final java.util.Map<COSObject,java.lang.ref.SoftReference<PDExtendedGraphicsState>> extGStates
private final java.util.Map<COSObject,java.lang.ref.SoftReference<PDAbstractPattern>> patterns
private final java.util.Map<COSObject,java.lang.ref.SoftReference<PDPropertyList>> properties
public PDFont getFont(COSObject indirect) throws java.io.IOException
ResourceCache
getFont
in interface ResourceCache
indirect
- the indirect objectjava.io.IOException
- if something went wrong.public void put(COSObject indirect, PDFont font) throws java.io.IOException
ResourceCache
put
in interface ResourceCache
indirect
- the indirect object of the resource.font
- the font resource.java.io.IOException
- if something went wrong.public PDColorSpace getColorSpace(COSObject indirect) throws java.io.IOException
ResourceCache
getColorSpace
in interface ResourceCache
indirect
- the indirect objectjava.io.IOException
- if something went wrong.public void put(COSObject indirect, PDColorSpace colorSpace) throws java.io.IOException
ResourceCache
put
in interface ResourceCache
indirect
- the indirect object of the resource.colorSpace
- the color space resource.java.io.IOException
- if something went wrong.public PDExtendedGraphicsState getExtGState(COSObject indirect)
ResourceCache
getExtGState
in interface ResourceCache
indirect
- the indirect objectpublic void put(COSObject indirect, PDExtendedGraphicsState extGState)
ResourceCache
put
in interface ResourceCache
indirect
- the indirect object of the resource.extGState
- the extended graphics state resource.public PDShading getShading(COSObject indirect) throws java.io.IOException
ResourceCache
getShading
in interface ResourceCache
indirect
- the indirect objectjava.io.IOException
- if something went wrong.public void put(COSObject indirect, PDShading shading) throws java.io.IOException
ResourceCache
put
in interface ResourceCache
indirect
- the indirect object of the resource.shading
- the shading resource.java.io.IOException
- if something went wrong.public PDAbstractPattern getPattern(COSObject indirect) throws java.io.IOException
ResourceCache
getPattern
in interface ResourceCache
indirect
- the indirect objectjava.io.IOException
- if something went wrong.public void put(COSObject indirect, PDAbstractPattern pattern) throws java.io.IOException
ResourceCache
put
in interface ResourceCache
indirect
- the indirect object of the resource.pattern
- the pattern resource.java.io.IOException
- if something went wrong.public PDPropertyList getProperties(COSObject indirect)
ResourceCache
getProperties
in interface ResourceCache
indirect
- the indirect objectpublic void put(COSObject indirect, PDPropertyList propertyList)
ResourceCache
put
in interface ResourceCache
indirect
- the indirect object of the resource.propertyList
- the property list resource.public PDXObject getXObject(COSObject indirect) throws java.io.IOException
ResourceCache
getXObject
in interface ResourceCache
indirect
- the indirect objectjava.io.IOException
- if something went wrong.public void put(COSObject indirect, PDXObject xobject) throws java.io.IOException
ResourceCache
put
in interface ResourceCache
indirect
- the indirect object of the resource.xobject
- the XObject resource.java.io.IOException
- if something went wrong.