|
xmlgraphics-commons 2.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.xmlgraphics.ps.dsc.ResourceTracker
public class ResourceTracker
This class is used to track resources in a DSC-compliant PostScript file. The distinction is made between supplied and needed resources. For the details of this distinction, please see the DSC specification.
| Constructor Summary | |
|---|---|
ResourceTracker()
|
|
| Method Summary | |
|---|---|
void |
declareInlined(PSResource res)
This method declares that the given resource will be inlined and can therefore be removed from resource tracking. |
Set |
getDocumentNeededResources()
Returns the set of needed resources. |
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(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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceTracker()
| Method Detail |
|---|
public Set getDocumentSuppliedResources()
public 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(Collection resources)
resources - the resources being usedpublic boolean isResourceSupplied(PSResource res)
res - the resource
public void writeResources(boolean pageLevel,
PSGenerator gen)
throws 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 with
IOException - In case of an I/O problem
public void writePageResources(PSGenerator gen)
throws IOException
gen - the PSGenerator to write the DSC comments with
IOException - In case of an I/O problem
public void writeDocumentResources(PSGenerator gen)
throws IOException
gen - the PSGenerator to write the DSC comments with
IOException - In case of an I/O problempublic void declareInlined(PSResource res)
res - the resourcepublic long getUsageCount(PSResource res)
res - the resource
|
xmlgraphics-commons 2.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||