]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added makePageId method.
authorPeter Bernard West <pbwest@apache.org>
Wed, 25 Feb 2004 22:33:54 +0000 (22:33 +0000)
committerPeter Bernard West <pbwest@apache.org>
Wed, 25 Feb 2004 22:33:54 +0000 (22:33 +0000)
Cleaned up Javadoc link to inaccessible method.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197374 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/pagination/FoLayoutMasterSet.java

index bd58976d3cb38822a3072c41717caa90bf1f7b4f..776591c54b55268857de3cd9b5ef4117b090850b 100644 (file)
@@ -26,6 +26,7 @@ import java.util.Map;
 import java.util.NoSuchElementException;
 
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.apps.Fop;
 import org.apache.fop.datastructs.TreeException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOTree;
@@ -51,8 +52,7 @@ public class FoLayoutMasterSet extends FONode {
 
     /** Map of <tt>Integer</tt> indices of <i>sparsePropsSet</i> array.
         It is indexed by the FO index of the FO associated with a given
-        position in the <i>sparsePropsSet</i> array.  See
-        {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}.
+        position in the <i>sparsePropsSet</i> array.
      */
     private static final int[] sparsePropsMap;
 
@@ -240,5 +240,25 @@ public class FoLayoutMasterSet extends FONode {
     public Map getPageSequenceMasters() {
         return finalPageSequenceMasters;
     }
-        
+
+    /**
+     * The genrator field for page ids.
+     * These page ids generated within any given instance of
+     * <code>FoLayoutMasterSet</code> increase monotonically from 1 through
+     * the range of values of <code>long</code>.  They wrap around when that
+     * range is exhausted, but the value 0 is never returned.
+     */
+    private long pageId = 0;
+    
+    /**
+     * @return a <code>long</code> page id not equal to 0.
+     */
+    public long makePageId() {
+        if (++pageId == 0) {
+            ++pageId;   // 0 is invalid
+            Fop.logger.warning("Page ID rollover.");
+        }
+        return pageId;
+    }
+    
 }// FoLayoutMasterSet