FreeHEP API
Version current

org.freehep.graphicsio.pdf
Class PDFRedundanceTracker

java.lang.Object
  extended byorg.freehep.graphicsio.pdf.PDFRedundanceTracker

public class PDFRedundanceTracker
extends Object

This class keeps track of all kinds of objects written to a pdf file and avoids to write them several times instead of referencing the same object several times. Right now only encoding tables are supported. An implementation for images and paint would be possible.

Version:
$Id: PDFRedundanceTracker.java,v 1.2 2002/07/10 20:55:38 duns Exp $
Author:
Simon Fischer
Source Code:
PDFRedundanceTracker.java

Nested Class Summary
static interface PDFRedundanceTracker.Writer
          To be implemented by Writers which write objects that may already have been written.
 
Constructor Summary
PDFRedundanceTracker(PDFWriter pdf)
           
 
Method Summary
 Collection getGroup(Object groupID)
          Returns all objects belonging to a particular group.
 PDFRef getReference(Object object, Object groupID, PDFRedundanceTracker.Writer writer)
          Returns a reference that points to object.
 PDFRef getReference(Object object, PDFRedundanceTracker.Writer writer)
           
 void writeAll()
          Writes all objects that are not yet written.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFRedundanceTracker

public PDFRedundanceTracker(PDFWriter pdf)
Method Detail

getReference

public PDFRef getReference(Object object,
                           Object groupID,
                           PDFRedundanceTracker.Writer writer)
Returns a reference that points to object. When this method is called several times for the same object (according to its hash code) the same reference is returned. When writeAll() is called the writer's writeObject() method will be called once with object as argument.
The groupID is only used for getGroup()


getReference

public PDFRef getReference(Object object,
                           PDFRedundanceTracker.Writer writer)

writeAll

public void writeAll()
Writes all objects that are not yet written. If the method is called several times then each times only the new objects are written.


getGroup

public Collection getGroup(Object groupID)
Returns all objects belonging to a particular group.


FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.