From d3173308a9a97f86974deb0d34a258c45b4a2a6e Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Fri, 16 Apr 2004 05:18:52 +0000 Subject: [PATCH] Added getNextPageId and getLogger methods 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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/java/org/apache/fop/fo/FOTree.java b/src/java/org/apache/fop/fo/FOTree.java index 2239ec6be..c58ea5a2f 100644 --- a/src/java/org/apache/fop/fo/FOTree.java +++ b/src/java/org/apache/fop/fo/FOTree.java @@ -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 getNextPageId method. + * The value is irrelevant. */ + private Boolean lock = new Boolean(true); + public long getNextPageId() { + synchronized (lock) { + return ++nextPageId; + } + } + /** * The buffer from which the XmlEvents from the parser will * be read. protected 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 FOTree logger + * @return the logger + */ + public Logger getLogger() { + return log; + } + }// FOTree -- 2.39.5