pbwest 2002/11/29 09:35:24
Modified: src/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design
XMLEvent.java
Log:
Add id field.
Revision Changes Path
No revision
No revision
1.1.2.9 +16 -7 xml-fop/src/org/apache/fop/xml/Attic/XMLEvent.java
Index: XMLEvent.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/xml/Attic/XMLEvent.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- XMLEvent.java 27 Nov 2002 03:25:18 -0000 1.1.2.8
+++ XMLEvent.java 29 Nov 2002 17:35:24 -0000 1.1.2.9
@@ -67,6 +67,9 @@
protected AttributesImpl attributes;
protected XMLNamespaces namespaces;
+ /** Sequence id for this <i>XMLEvent</i>. */
+ public final int id;
+
/**
* The one-argument constructor uses the default initialization values:
* NOEVENT for the event <i>type</i>, and null references for all others
@@ -74,6 +77,7 @@
*/
public XMLEvent (XMLNamespaces namespaces) {
this.namespaces = namespaces;
+ id = namespaces.getSequence();
}
/**
@@ -84,13 +88,14 @@
String localName, String qName,
AttributesImpl attributes, XMLNamespaces namespaces)
{
+ this.namespaces = namespaces;
+ id = namespaces.getSequence();
this.type = type;
this.chars = chars;
this.uriIndex = uriIndex;
this.localName = localName;
this.qName = qName;
this.attributes = attributes;
- this.namespaces = namespaces;
}
/**
@@ -98,24 +103,26 @@
* <tt>XMLEvent</tt> object.
*/
public XMLEvent(XMLEvent ev) {
+ namespaces = ev.namespaces;
+ id = namespaces.getSequence();
type = ev.type;
chars = ev.chars;
uriIndex = ev.uriIndex;
localName = ev.localName;
qName = ev.qName;
attributes = ev.attributes;
- namespaces = ev.namespaces;
}
public XMLEvent(int type, String chars, XMLNamespaces namespaces) {
+ this.namespaces = namespaces;
+ id = namespaces.getSequence();
this.type = type;
this.chars = chars;
- this.namespaces = namespaces;
}
/**
* Clear the fields of this event. Provided for pool operations.
- * The <i>namespaces</i> field is not cleared.
+ * Neither the <i>namespaces</i> nor the <i>id</i> field is cleared.
* @return the cleared event.
*/
public XMLEvent clear() {
@@ -225,6 +232,8 @@
public String toString() {
String tstr;
tstr = eventTypeName(type);
+ tstr = tstr + "\nSeq " + id;
+ tstr = tstr + "\nNamespaces " + namespaces.hashCode();
tstr = tstr + "\nURI "
+ uriIndex + " " + namespaces.getIndexURI(uriIndex);
tstr = tstr + "\n" + "Local Name " + localName;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]