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/02/25 23:33:54 UTC
cvs commit: xml-fop/src/java/org/apache/fop/fo/pagination FoLayoutMasterSet.java
pbwest 2004/02/25 14:33:54
Modified: src/java/org/apache/fop/fo/pagination Tag:
FOP_0-20-0_Alt-Design FoLayoutMasterSet.java
Log:
Added makePageId method.
Cleaned up Javadoc link to inaccessible method.
Revision Changes Path
No revision
No revision
1.1.2.9 +26 -6 xml-fop/src/java/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java
Index: FoLayoutMasterSet.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- FoLayoutMasterSet.java 28 Jan 2004 06:24:30 -0000 1.1.2.8
+++ FoLayoutMasterSet.java 25 Feb 2004 22:33:54 -0000 1.1.2.9
@@ -26,6 +26,7 @@
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 @@
/** 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 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
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org