]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added copyEvent() methods.
authorPeter Bernard West <pbwest@apache.org>
Sun, 1 Dec 2002 14:51:58 +0000 (14:51 +0000)
committerPeter Bernard West <pbwest@apache.org>
Sun, 1 Dec 2002 14:51:58 +0000 (14:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@195695 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/xml/FoXMLEvent.java
src/org/apache/fop/xml/XMLEvent.java

index 5554dfbb3348edb8d2f992e093e9b2f567788a49..9b500e4689d72ecac4feec4a5cadc7dd4e034851 100644 (file)
@@ -75,7 +75,7 @@ public class FoXMLEvent extends XMLEvent {
 
     /**
      * Clear the fields of this event.  Provided for pool operations.
-     * The <i>namespaces</i> field is not cleared.
+     * Neither the <i>namespaces</i> nor the <i>id</i> field is cleared.
      * @return the cleared <tt>XMLEvent</tt> event.
      */
     public XMLEvent clear() {
@@ -85,13 +85,37 @@ public class FoXMLEvent extends XMLEvent {
 
     /**
      * Clear the fields of this event.  Provided for pool operations.
-     * The <i>namespaces</i> field is not cleared.
+     * Neither the <i>namespaces</i> nor the <i>id</i> field is cleared.
      * @return the cleared <tt>XMLEvent</tt> event.
      */
     public FoXMLEvent clearFo() {
         return (FoXMLEvent)clear();
     }
 
+    /**
+     * Copy the fields of the argument event to this event.
+     * Provided for pool operations.
+     * Neither the <i>namespaces</i> nor the <i>id</i> field is copied.
+     * The <i>namespaces</i> field is not cleared.
+     * @param ev the <tt>XMLEvent</tt> to copy.
+     * @return the copied <tt>XMLEvent</tt> event.
+     */
+    public XMLEvent copyEvent(FoXMLEvent ev) {
+        foType = ev.foType;
+        return super.copyEvent(ev);
+    }
+
+    /**
+     * Copy the fields of the argument event to this event.
+     * Provided for pool operations.
+     * Neither the <i>namespaces</i> nor the <i>id</i> field is copied.
+     * The <i>namespaces</i> field is not cleared.
+     * @return the copied <tt>XMLEvent</tt> event.
+     */
+    public FoXMLEvent copyFoEvent(FoXMLEvent ev) {
+        return (FoXMLEvent)copyEvent(ev);
+    }
+
     /**
      * Get the FO type of this <i>FoXMLEvent</i>.
      * @returns the FO type.
index d4d1785d781ef5728342e372721f00b8ff500b70..a73682dca126995e971aff16c1c8bb69ea9bc653 100644 (file)
@@ -135,6 +135,23 @@ public class XMLEvent {
         return this;
     }
 
+    /**
+     * Copy the fields of the argument event to this event.
+     * Provided for pool operations.
+     * Neither the <i>namespaces</i> nor the <i>id</i> field is copied.
+     * @param ev the <tt>XMLEvent</tt> to copy.
+     * @return this (copied) event.
+     */
+    public XMLEvent copyEvent(XMLEvent ev) {
+        type = ev.type;
+        chars = ev.chars;
+        uriIndex = ev.uriIndex;
+        localName = ev.localName;
+        qName = ev.qName;
+        attributes = ev.attributes;
+        return this;
+    }
+
     public int getType() { return type; }
     public void setType(int type) {
         if (type < MIN_XML_EV_TYPE || type > MAX_XML_EV_TYPE) {