]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added getNextPageId and getLogger methods
authorPeter Bernard West <pbwest@apache.org>
Fri, 16 Apr 2004 05:18:52 +0000 (05:18 +0000)
committerPeter Bernard West <pbwest@apache.org>
Fri, 16 Apr 2004 05:18:52 +0000 (05:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197514 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/FOTree.java

index 2239ec6be98140120d8dc848416519658548386e..c58ea5a2fbef6d9c3f26629600ddbf96f0ae9f2b 100644 (file)
@@ -43,6 +43,17 @@ public class FOTree extends Tree implements Runnable {
     private static final String tag = "$Name$";
     private static final String revision = "$Revision$";
 
+    /** Provides a monotonically increasing pageId */
+    private long nextPageId = 0;
+    /** Locking object for synchronizing <code>getNextPageId</code> method.
+     * The value is irrelevant. */
+    private Boolean lock = new Boolean(true);
+    public long getNextPageId() {
+        synchronized (lock) {
+            return ++nextPageId;
+        }
+    }
+
     /**
      * The buffer from which the <tt>XmlEvent</tt>s from the parser will
      * be read.  <tt>protected</tt> so that FONode can access it.
@@ -167,4 +178,12 @@ public class FOTree extends Tree implements Runnable {
         System.out.println("# of FONodes: " + nodecount);
     }
 
+    /**
+     * Gets the <code>FOTree</code> logger
+     * @return the logger
+     */
+    public Logger getLogger() {
+        return log;
+    }
+
 }// FOTree