pbwest 2002/11/29 09:24:05
Modified: src/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design
XMLNamespaces.java
Log:
Added sequence, seqMask and getSequence().
Revision Changes Path
No revision
No revision
1.1.2.3 +28 -3 xml-fop/src/org/apache/fop/xml/Attic/XMLNamespaces.java
Index: XMLNamespaces.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/xml/Attic/XMLNamespaces.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XMLNamespaces.java 3 Oct 2002 03:27:29 -0000 1.1.2.2
+++ XMLNamespaces.java 29 Nov 2002 17:24:05 -0000 1.1.2.3
@@ -67,6 +67,31 @@
*/
private ArrayList uris;
+ /**
+ * A sequence object for use by <tt>XMLEvent</tt>s. Because an
+ * <tt>XMLEvent</tt> object must always be associated with an
+ * <i>XMLNamespace</i> object, this namespace object will act as a
+ * singleton for <tt>XMLEvent</tt>s. This field provides a
+ * counter for those objects. The range of values which may be
+ * assigned to <i>sequence</i> is restricted by <i>seqMask</i>.
+ */
+ private int sequence = 0;
+
+ /** Mask to restrict the range of values within which <i>sequence</i>
+ * may cycle.
+ */
+ public final int seqMask = (1 << 20) - 1;
+
+ /**
+ * The access function for the sequence.
+ * @return the next positive sequence number. This number may wrap
+ * but is guaranteed to be within the range seqMask >= sequence >= 0.
+ */
+ public int getSequence() {
+ sequence = ++sequence & seqMask;
+ return sequence;
+ }
+
public XMLNamespaces() {
uriIndices = new HashMap(4);
uris = new ArrayList(4);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]