public class ResourceTracker
extends java.lang.Object
Constructor and Description |
---|
ResourceTracker() |
Modifier and Type | Method and Description |
---|---|
void |
declareInlined(PSResource res)
This method declares that the given resource will be inlined and can therefore
be removed from resource tracking.
|
java.util.Set |
getDocumentNeededResources()
Returns the set of needed resources.
|
java.util.Set |
getDocumentSuppliedResources()
Returns the set of supplied resources.
|
long |
getUsageCount(PSResource res)
Returns the number of times a resource has been used inside the current DSC document.
|
boolean |
isResourceSupplied(PSResource res)
Indicates whether a particular resource is supplied, rather than needed.
|
void |
notifyResourceUsageOnPage(java.util.Collection resources)
Notifies the resource tracker about the usage of resources on the current page.
|
void |
notifyResourceUsageOnPage(PSResource res)
Notifies the resource tracker about the usage of a resource on the current page.
|
void |
notifyStartNewPage()
Notifies the resource tracker that a new page has been started and that the page resource
set can be cleared.
|
void |
registerNeededResource(PSResource res)
Registers a needed resource.
|
void |
registerSuppliedResource(PSResource res)
Registers a supplied resource.
|
void |
writeDocumentResources(PSGenerator gen)
Writes a DSC comment for the needed and supplied resourced for the current DSC document.
|
void |
writePageResources(PSGenerator gen)
Writes a DSC comment for the accumulated used resources on the current page.
|
void |
writeResources(boolean pageLevel,
PSGenerator gen)
Writes a DSC comment for the accumulated used resources, either at page level or
at document level.
|
public java.util.Set getDocumentSuppliedResources()
public java.util.Set getDocumentNeededResources()
public void notifyStartNewPage()
public void registerSuppliedResource(PSResource res)
res
- the resourcepublic void registerNeededResource(PSResource res)
res
- the resourcepublic void notifyResourceUsageOnPage(PSResource res)
res
- the resource being usedpublic void notifyResourceUsageOnPage(java.util.Collection resources)
resources
- the resources being usedpublic boolean isResourceSupplied(PSResource res)
res
- the resourcepublic void writeResources(boolean pageLevel, PSGenerator gen) throws java.io.IOException
pageLevel
- true if the DSC comment for the page level should be generated,
false for the document level (in the trailer)gen
- the PSGenerator to write the DSC comments withjava.io.IOException
- In case of an I/O problempublic void writePageResources(PSGenerator gen) throws java.io.IOException
gen
- the PSGenerator to write the DSC comments withjava.io.IOException
- In case of an I/O problempublic void writeDocumentResources(PSGenerator gen) throws java.io.IOException
gen
- the PSGenerator to write the DSC comments withjava.io.IOException
- In case of an I/O problempublic void declareInlined(PSResource res)
res
- the resourcepublic long getUsageCount(PSResource res)
res
- the resourceCopyright 1999-2012 The Apache Software Foundation. All Rights Reserved.