cvs commit: xml-fop/src/java/org/apache/fop/xml XMLNamespaces.java
pbwest 2004/01/14 08:11:23 Modified:src/java/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design XMLNamespaces.java Log: Variable name changes and other changes to support UriLocalName pool Use org.apache.fop.pool package classes Revision ChangesPath No revision No revision 1.1.2.5 +87 -39xml-fop/src/java/org/apache/fop/xml/Attic/XMLNamespaces.java Index: XMLNamespaces.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/xml/Attic/XMLNamespaces.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- XMLNamespaces.java10 Jan 2004 06:29:50 - 1.1.2.4 +++ XMLNamespaces.java14 Jan 2004 16:11:22 - 1.1.2.5 @@ -50,10 +50,11 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.datastructs.SyncedCircularBuffer; +import org.apache.fop.pool.*; /** - * Maintains the namespaces encountered by an invocation of ttXMLSerialHandler/tt. - * p + * Maintains the namespaces encountered by an invocation of + * ttXMLSerialHandler/tt. * One instance of iXMLNamespaces/i is maintained across all documents * that may be processed in a single invocation of ttXMLSerialhandler/tt. * A reference to that instance is kept with every instance of ttXMLEvent/tt. @@ -84,6 +85,12 @@ public static final String SVGNamespace = http://www.w3.org/2000/svg;; public static final int NO_NAMESPACE = -1; + +/** + * Generic undefined type for namespace-specific event types. + */ +public static final int NO_NS_TYPE = -1; + /** Index for associated namespace */ public static final int DefAttrNSIndex = 0 ,XSLNSpaceIndex = 1 @@ -119,20 +126,31 @@ * namespace active in the current document. */ private XMLEventPool[] pools = new XMLEventPool[LAST_NS_INDEX + 1]; + +/** + * The pool for codeUriLocalName/code objects. + */ +private UriLocalNamePool uriLocalNamePool; /** - * Sequence objects for use by ttXMLEvent/tts. Because an + * Sequenced objects for use by ttXMLEvent/tts. Because an * ttXMLEvent/tt object must always be associated with an * iXMLNamespace/i object, this namespace object will act as a * singleton for ttXMLEvent/tts. This field provides a counter for * those objects. The range of values which may be assigned to - * isequence/i is restricted by iseqMask/i. + * insSequences/i is restricted by insSeqMasks/i. + */ +private int nsSequences[] = new int[LAST_NS_INDEX + 1]; + +/** + * This field is used to provide sequence numbers for + * codePoolable UriLocalName/code objects. */ -private int sequence[] = new int[LAST_NS_INDEX + 1]; +private int uriLocalSeq = 0; /** - * Number of bits in the sequence mask for the associated namespace. - * This value will determine the number of sequence values the pool + * Number of bits in the nsSequences mask for the associated namespace. + * This value will determine the number of nsSequences values the pool * for the associated namespace will track. */ private static final int DEF_ATTR_SEQ_BITS = 14 @@ -142,39 +160,46 @@ ; /** - * Masks to restrict the range of values within which the sequence value + * Masks to restrict the range of values within which the nsSequences value * for each namespace may cycle. */ -private final int[] seqMask = +private final int[] nsSeqMasks = { (1 DEF_ATTR_SEQ_BITS) - 1 ,(1 FO_SEQ_BITS) - 1 ,(1 FOX_SEQ_BITS) - 1 ,(1 SVG_SEQ_BITS) - 1 }; + +/** + * Mask to restrict the range of values within which uriLocalSeq will + * cycle. + */ +private final int uriLocalSeqMask = (1 FO_SEQ_BITS) - 1; public XMLNamespaces() { for (int i = 0; i = LAST_NS_INDEX; i++) { pools[i] = null; -sequence[i] = 0; +nsSequences[i] = 0; } pools[DefAttrNSIndex] = -new XMLEventPool(this, INITIAL_DEF_ATTR_NS_POOL_SIZE); +new XMLEventPool(INITIAL_DEF_ATTR_NS_POOL_SIZE); pools[XSLNSpaceIndex] = -new XMLEventPool(this, INITIAL_XSL_NS_POOL_SIZE); +new XMLEventPool(INITIAL_XSL_NS_POOL_SIZE); pools[FOXNSpaceIndex] = -new XMLEventPool(this, INITIAL_FOX_NS_POOL_SIZE); +new XMLEventPool(INITIAL_FOX_NS_POOL_SIZE); pools[SVGNSpaceIndex] = -new XMLEventPool(this,
cvs commit: xml-fop/src/java/org/apache/fop/xml XMLNamespaces.java
pbwest 2004/01/14 18:57:24 Removed: src/java/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design XMLNamespaces.java Log: XMLNamespaces renamed to Namespaces - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/xml XMLNamespaces.java
pbwest 2004/01/01 04:31:09 Modified:src/java/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design XMLNamespaces.java Log: Remove intern() call. Slows processing to no obvious benefit. Revision ChangesPath No revision No revision 1.1.2.3 +4 -4 xml-fop/src/java/org/apache/fop/xml/Attic/XMLNamespaces.java Index: XMLNamespaces.java === RCS file: /home/cvs/xml-fop/src/java/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.java28 Dec 2003 03:58:54 - 1.1.2.2 +++ XMLNamespaces.java1 Jan 2004 12:31:08 - 1.1.2.3 @@ -177,7 +177,7 @@ i = uris.size(); //System.out.println(Adding namespace + uri + + i); uriIndices.put(uri, Ints.consts.get(i)); -uris.add(i, uri.intern()); +uris.add(i, uri); return i; } // not null - found the integer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/xml XMLNamespaces.java
pbwest 2003/12/27 19:58:54 Modified:src/java/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design XMLNamespaces.java Log: Change pre-installed namespace URIs - remove XLink and include FOX. Define SEQ_BITS as 18 for tracking pool usage. (This and related seqMask and getSequence()should probably be elsewhere.) intern() URI string. Revision ChangesPath No revision No revision 1.1.2.2 +19 -13xml-fop/src/java/org/apache/fop/xml/Attic/XMLNamespaces.java Index: XMLNamespaces.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/xml/Attic/XMLNamespaces.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- XMLNamespaces.java5 Jul 2003 19:12:36 - 1.1.2.1 +++ XMLNamespaces.java28 Dec 2003 03:58:54 - 1.1.2.2 @@ -75,13 +75,13 @@ public static final String DefAttrNSpace = ; public static final String XSLNamespace = http://www.w3.org/1999/XSL/Format;; +public static final String FOXNamespace = +http://xml.apache.org/fop/extensions;; public static final String SVGNamespace = http://www.w3.org/2000/svg;; -public static final String XlinkNamespace = -http://www.w3.org/1999/xlink;; public static final int DefAttrNSIndex = 0; public static final int XSLNSpaceIndex = 1; -public static final int SVGNSpaceIndex = 2; -public static final int XLinkNSpaceIndex = 3; +public static final int FOXNSpaceIndex = 2; +public static final int SVGNSpaceIndex = 3; /** * A ttHashMap/tt mapping a namespace URI to an ttint/tt @@ -122,10 +122,16 @@ */ private int sequence = 0; +/** + * Number of bits in the sequence mask. This value will determine + * the number of sequence values the pool will track. + */ +private static final int SEQ_BITS = 18; + /** Mask to restrict the range of values within which isequence/i * may cycle. */ -public final int seqMask = (1 20) - 1; +public final int seqMask = (1 SEQ_BITS) - 1; /** * The access function for the sequence. @@ -138,16 +144,16 @@ } public XMLNamespaces() { -uriIndices = new HashMap(4); -uris = new ArrayList(4); +uriIndices = new HashMap((int)(6/0.75)); +uris = new ArrayList(6); uriIndices.put(DefAttrNSpace, Ints.consts.get(DefAttrNSIndex)); uris.add(DefAttrNSIndex, DefAttrNSpace); uriIndices.put(XSLNamespace, Ints.consts.get(XSLNSpaceIndex)); uris.add(XSLNSpaceIndex, XSLNamespace); +uriIndices.put(FOXNamespace, Ints.consts.get(FOXNSpaceIndex)); +uris.add(FOXNSpaceIndex, FOXNamespace); uriIndices.put(SVGNamespace, Ints.consts.get(SVGNSpaceIndex)); uris.add(SVGNSpaceIndex, SVGNamespace); -uriIndices.put(XlinkNamespace, Ints.consts.get(XLinkNSpaceIndex)); -uris.add(XLinkNSpaceIndex, XlinkNamespace); } /** @@ -171,7 +177,7 @@ i = uris.size(); //System.out.println(Adding namespace + uri + + i); uriIndices.put(uri, Ints.consts.get(i)); -uris.add(i, uri); +uris.add(i, uri.intern()); return i; } // not null - found the integer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/xml XMLNamespaces.java FoXMLEvent.java SyncedFoXmlEventsBuffer.java FoXMLSerialHandler.java XMLEventPool.java UriLocalName.java package.html UnexpectedStartElementException.java FoXMLEventPool.java XMLEvent.java
pbwest 2003/07/05 12:12:36 Added: src/java/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design XMLNamespaces.java FoXMLEvent.java SyncedFoXmlEventsBuffer.java FoXMLSerialHandler.java XMLEventPool.java UriLocalName.java package.html UnexpectedStartElementException.java FoXMLEventPool.java XMLEvent.java Log: Moved from src to src/java. Revision ChangesPath No revision No revision 1.1.2.1 +189 -0xml-fop/src/java/org/apache/fop/xml/Attic/XMLNamespaces.java 1.1.2.1 +187 -0xml-fop/src/java/org/apache/fop/xml/Attic/FoXMLEvent.java 1.1.2.1 +1300 -0 xml-fop/src/java/org/apache/fop/xml/Attic/SyncedFoXmlEventsBuffer.java 1.1.2.1 +257 -0 xml-fop/src/java/org/apache/fop/xml/Attic/FoXMLSerialHandler.java 1.1.2.1 +159 -0xml-fop/src/java/org/apache/fop/xml/Attic/XMLEventPool.java 1.1.2.1 +20 -0 xml-fop/src/java/org/apache/fop/xml/Attic/UriLocalName.java 1.1.2.1 +6 -0 xml-fop/src/java/org/apache/fop/xml/Attic/package.html 1.1.2.1 +77 -0 xml-fop/src/java/org/apache/fop/xml/Attic/UnexpectedStartElementException.java 1.1.2.1 +103 -0xml-fop/src/java/org/apache/fop/xml/Attic/FoXMLEventPool.java 1.1.2.1 +319 -0xml-fop/src/java/org/apache/fop/xml/Attic/XMLEvent.java - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]