pbwest      2002/11/23 06:42:05

  Modified:    src/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design
                        FoXMLEvent.java FoXMLSerialHandler.java
                        SyncedFoXmlEventsBuffer.java XMLEvent.java
  Added:       src/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design
                        FoXMLEventPool.java XMLEventPool.java
  Log:
  Extended for XMLEvent pool.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +20 -3     xml-fop/src/org/apache/fop/xml/Attic/FoXMLEvent.java
  
  Index: FoXMLEvent.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/xml/Attic/FoXMLEvent.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- FoXMLEvent.java   24 Oct 2002 14:39:11 -0000      1.1.2.1
  +++ FoXMLEvent.java   23 Nov 2002 14:42:04 -0000      1.1.2.2
  @@ -73,8 +73,25 @@
           this.foType = foType;
       }
   
  +    /**
  +     * Clear the fields of this event.  Provided for pool operations.
  +     * The <i>namespaces</i> field is not cleared.
  +     */
  +    public void clear() {
  +        super.clear();
  +        foType = FObjectNames.NO_FO;
  +    }
  +
  +    /**
  +     * Get the FO type of this <i>FoXMLEvent</i>.
  +     * @returns the FO type.
  +     */
       public int getFoType() { return foType; }
   
  +    /**
  +     * Set the FO type of this <i>FoXMLEvent</i>.
  +     * @param foType -the FO type.
  +     */
       public void setFoType(int foType) { this.foType = foType; }
   
       public String toString() {
  
  
  
  1.1.2.3   +8 -3      xml-fop/src/org/apache/fop/xml/Attic/FoXMLSerialHandler.java
  
  Index: FoXMLSerialHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/xml/Attic/FoXMLSerialHandler.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- FoXMLSerialHandler.java   13 Nov 2002 15:25:19 -0000      1.1.2.2
  +++ FoXMLSerialHandler.java   23 Nov 2002 14:42:05 -0000      1.1.2.3
  @@ -3,6 +3,7 @@
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.xml.XMLNamespaces;
   import org.apache.fop.xml.SyncedFoXmlEventsBuffer;
  +import org.apache.fop.xml.FoXMLEventPool;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.apps.Driver;
   import org.apache.fop.configuration.Configuration;
  @@ -43,6 +44,9 @@
       private Thread foThread;
       private boolean errorDump;
   
  +    /** The pool associated with the buffer. */
  +    private FoXMLEventPool pool;
  +
       /**
        * @param events the events buffer.
        * @param parser the xml parser.
  @@ -57,6 +61,7 @@
           namespaces = events.getNamespaces();
           parser.setContentHandler(this);
           errorDump = Configuration.getBooleanValue("debugMode").booleanValue();
  +        pool = events.getPool();
       }
   
       public void setFoThread(Thread foThread) {
  
  
  
  1.1.2.5   +17 -2     
xml-fop/src/org/apache/fop/xml/Attic/SyncedFoXmlEventsBuffer.java
  
  Index: SyncedFoXmlEventsBuffer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/xml/Attic/SyncedFoXmlEventsBuffer.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- SyncedFoXmlEventsBuffer.java      13 Nov 2002 15:29:36 -0000      1.1.2.4
  +++ SyncedFoXmlEventsBuffer.java      23 Nov 2002 14:42:05 -0000      1.1.2.5
  @@ -5,6 +5,8 @@
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FObjectSets;
   
  +import org.apache.fop.xml.FoXMLEventPool;
  +
   import java.util.NoSuchElementException;
   import java.util.LinkedList;
   import java.util.Iterator;
  @@ -33,6 +35,11 @@
       private XMLNamespaces namespaces;
   
       /**
  +     * The FoXMLEventPool for this buffer.
  +     */
  +    private FoXMLEventPool pool;
  +
  +    /**
        * No-argument constructor sets up a buffer with the default number of
        * elements.
        * The producer and consumer <tt>Thread</tt>s default to the current
  @@ -43,6 +50,7 @@
       {
           super();
           namespaces = new XMLNamespaces();
  +        pool = new FoXMLEventPool(namespaces);
       }
   
       /**
  @@ -54,6 +62,7 @@
       {
           super(size);
           namespaces = new XMLNamespaces();
  +        pool = new FoXMLEventPool(namespaces);
       }
   
       /**
  @@ -61,6 +70,12 @@
        * @return - the namespaces object.
        */
       public XMLNamespaces getNamespaces() { return namespaces; }
  +
  +    /**
  +     * Get the <tt>FoXMLEventPool</tt> from this buffer.
  +     * @return - the pool object.
  +     */
  +    public FoXMLEventPool getPool() { return pool; }
   
       /**
        * @return next event from the SyncedCircularBuffer
  
  
  
  1.1.2.7   +24 -3     xml-fop/src/org/apache/fop/xml/Attic/XMLEvent.java
  
  Index: XMLEvent.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/xml/Attic/XMLEvent.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- XMLEvent.java     24 Oct 2002 14:34:31 -0000      1.1.2.6
  +++ XMLEvent.java     23 Nov 2002 14:42:05 -0000      1.1.2.7
  @@ -113,6 +113,19 @@
           this.namespaces = namespaces;
       }
   
  +    /**
  +     * Clear the fields of this event.  Provided for pool operations.
  +     * The <i>namespaces</i> field is not cleared.
  +     */
  +    public void clear() {
  +        type = NOEVENT;
  +        chars = null;
  +        uriIndex = 0;
  +        localName = null;
  +        qName = null;
  +        attributes = null;
  +    }
  +
       public int getType() { return type; }
       public void setType(int type) {
           if (type < MIN_XML_EV_TYPE || type > MAX_XML_EV_TYPE) {
  @@ -191,6 +204,14 @@
        */
       public void setAttributes(AttributesImpl attributes) {
           this.attributes = attributes;
  +    }
  +
  +    /**
  +     * Set the <tt>XMLNamespaces</tt> object associated with this event.
  +     * @param the <tt>XMLNamespaces</tt> object.
  +     */
  +    public void setNamespaces(XMLNamespaces namespaces) {
  +        this.namespaces = namespaces;
       }
   
       /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +59 -0     xml-fop/src/org/apache/fop/xml/Attic/FoXMLEventPool.java
  
  
  
  
  1.1.2.1   +64 -0     xml-fop/src/org/apache/fop/xml/Attic/XMLEventPool.java
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to