You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2004/01/16 16:24:25 UTC
cvs commit: xml-fop/src/java/org/apache/fop/datastructs SyncedCircularBuffer.java
pbwest 2004/01/16 07:24:25
Modified: src/java/org/apache/fop/datastructs Tag:
FOP_0-20-0_Alt-Design SyncedCircularBuffer.java
Log:
Added boolean isExhausted to allow SyncedXmlEventsBuffer
(which extends SyncedCircularBuffer) to implement the interface
XmlEventSource.
Revision Changes Path
No revision
No revision
1.1.2.3 +16 -9 xml-fop/src/java/org/apache/fop/datastructs/Attic/SyncedCircularBuffer.java
Index: SyncedCircularBuffer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datastructs/Attic/SyncedCircularBuffer.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- SyncedCircularBuffer.java 5 Jan 2004 02:01:38 -0000 1.1.2.2
+++ SyncedCircularBuffer.java 16 Jan 2004 15:24:25 -0000 1.1.2.3
@@ -1,10 +1,4 @@
/*
- * SyncedCircularBuffer.java
- * $Id$
- *
- * Created: Tue Nov 6 10:19:03 2001
- *
- *
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
@@ -53,8 +47,8 @@
* Software Foundation, please see <http://www.apache.org/>.
*
*
- * @author <a href="mailto:pbwest@powerup.com.au">Peter B. West</a>
- * @version $Revision$ $Name$
+ * $Id$
+ * Created: Tue Nov 6 10:19:03 2001
*/
package org.apache.fop.datastructs;
@@ -70,6 +64,9 @@
* <b>Warning</b>: if the producer or consumer thread dies unexpectedly,
* without interrupting the complementary thread's <tt>wait()</tt>, that
* process will hang on the <tt>wait()</tt>.
+ *
+ * @author <a href="mailto:pbwest@powerup.com.au">Peter B. West</a>
+ * @version $Revision$ $Name$
*/
public class SyncedCircularBuffer {
@@ -234,7 +231,8 @@
/**
* Notifies the consumer that the producer has terminated.
- * The <tt>notifyAll()</tt> call allows for processing of the buffer before it fills.
+ * The <tt>notifyAll()</tt> call allows for processing of the buffer before
+ * it fills.
*/
public void producerExhausted() {
synchronized (this) {
@@ -244,6 +242,15 @@
notifyAll();
}
}
+ }
+
+ /**
+ * Is this source of XmlEvents exhausted?
+ * @return true if the last event from the input stream (END_DOCUMENT)
+ * has been processed, and the buffer is empty.
+ */
+ public boolean isExhausted() {
+ return producerFinished && isEmpty();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org