pbwest      2002/11/26 19:31:16

  Modified:    src/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design
                        FoXMLEventPool.java
  Log:
  Changed acquireFoXMLEvent() to extend XMLEventPool.acquireEvent() and clear the 
FoType field.
  Added two-arg constructor with initialSize arg.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +17 -17    xml-fop/src/org/apache/fop/xml/Attic/FoXMLEventPool.java
  
  Index: FoXMLEventPool.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/xml/Attic/FoXMLEventPool.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- FoXMLEventPool.java       23 Nov 2002 14:42:05 -0000      1.1.2.1
  +++ FoXMLEventPool.java       27 Nov 2002 03:31:16 -0000      1.1.2.2
  @@ -1,12 +1,11 @@
   package org.apache.fop.xml;
   
   import org.apache.fop.apps.FOPException;
  +import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.xml.FoXMLEvent;
   import org.apache.fop.xml.XMLNamespaces;
   import org.apache.fop.xml.XMLEventPool;
   
  -import java.util.LinkedList;
  -
   /*
    * $Id$
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  @@ -25,29 +24,30 @@
       private static final String revision = "$Revision$";
   
       /**
  -     * The one-argument constructor uses the default initialization values:
  -     * NOEVENT for the event <i>type</i>, and null references for all others
  -     * except <i>namespaces</i>.
  +     * The one-argument constructor requires <i>namespaces</i>.
  +     * @param namespaces - an <tt>XMLNamespaces</tt> object.
        */
       public FoXMLEventPool(XMLNamespaces namespaces) {
           super(namespaces);
       }
   
       /**
  -     * Acquire an <tt>FoXMLEvent</tt>.
  -     * @return an <tt>FoXMLEvent</tt>.
  +     * Construct a pool with a given initial size.
  +     * @param namespaces - an <tt>XMLNamespaces</tt> object.
  +     * @param initialSize - the initial size of the pool.
        */
  -    public synchronized FoXMLEvent acquireFoXMLEvent() {
  -        return (FoXMLEvent)(acquireXMLEvent());
  +    public FoXMLEventPool(XMLNamespaces namespaces, int initialSize) {
  +        super(namespaces, initialSize);
       }
   
       /**
  -     * Return an <tt>FoXMLEvent</tt> to the pool.
  -     * @param ev - the event being returned.
  +     * Acquire an <tt>FoXMLEvent</tt>.
  +     * @return an <tt>FoXMLEvent</tt>.
        */
  -    public synchronized void surrenderFoXMLEvent(FoXMLEvent ev) {
  -        ev.clear();
  -        pool.add(ev);
  +    public synchronized FoXMLEvent acquireFoXMLEvent() {
  +        FoXMLEvent ev = (FoXMLEvent)(acquireXMLEvent());
  +        ev.setFoType(FObjectNames.NO_FO);
  +        return ev;
       }
   
       /**
  
  
  

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

Reply via email to