]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Add emptyBuffer() method
authorPeter Bernard West <pbwest@apache.org>
Tue, 20 Jan 2004 07:13:55 +0000 (07:13 +0000)
committerPeter Bernard West <pbwest@apache.org>
Tue, 20 Jan 2004 07:13:55 +0000 (07:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197225 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/xml/ArrayXmlEventsBuffer.java

index 47f206a514effa4ba9129022ce3369e8691f8e5d..755eb2c928488172b88b6cb82da430019c0d624b 100644 (file)
@@ -69,13 +69,6 @@ import org.apache.fop.apps.FOPException;
 public class ArrayXmlEventsBuffer
 implements XmlEventSource {
 
-    /**
-     * Constant for <i>discardEvent</i> field of
-     * <i>getEndElement(boolean discardEvent, XmlEvent(, boolean)).
-     */
-    public static final boolean DISCARD_EV = true,
-                                 RETAIN_EV = false;
-
     /**
      * The datastructure for the events buffer.
      */
@@ -185,4 +178,13 @@ implements XmlEventSource {
         // requirement, set bufferRead to false.
         nextEvent = 0;
     }
+    
+    public void emptyBuffer() {
+        rewindBuffer();
+        for (int i = buffer.size(); i >= 0; ) {
+            namespaces.relinquishEvent((XmlEvent)buffer.get(--i));
+            buffer.remove(i);
+        }
+    }
+    
 }