1*1212f9a0SAndroid Build Coastguard Worker<!-- 2*1212f9a0SAndroid Build Coastguard Worker * Licensed to the Apache Software Foundation (ASF) under one 3*1212f9a0SAndroid Build Coastguard Worker * or more contributor license agreements. See the NOTICE file 4*1212f9a0SAndroid Build Coastguard Worker * distributed with this work for additional information 5*1212f9a0SAndroid Build Coastguard Worker * regarding copyright ownership. The ASF licenses this file 6*1212f9a0SAndroid Build Coastguard Worker * to you under the Apache License, Version 2.0 (the "License"); 7*1212f9a0SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 8*1212f9a0SAndroid Build Coastguard Worker * You may obtain a copy of the License at 9*1212f9a0SAndroid Build Coastguard Worker * 10*1212f9a0SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 11*1212f9a0SAndroid Build Coastguard Worker * 12*1212f9a0SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 13*1212f9a0SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 14*1212f9a0SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15*1212f9a0SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 16*1212f9a0SAndroid Build Coastguard Worker * limitations under the License. 17*1212f9a0SAndroid Build Coastguard Worker--> 18*1212f9a0SAndroid Build Coastguard Worker<html><head><title></title></head><body> 19*1212f9a0SAndroid Build Coastguard Worker<center><h1>SAX2DTM Design Notes</h1></center> 20*1212f9a0SAndroid Build Coastguard Worker<p>The current implementation is subject to change and this class 21*1212f9a0SAndroid Build Coastguard Workershould be accessed only through published interface methods. However, 22*1212f9a0SAndroid Build Coastguard Workerthe following information is provided to aid in an understanding of how this 23*1212f9a0SAndroid Build Coastguard Workerclass currently works and is provided for debugging purposes only. 24*1212f9a0SAndroid Build Coastguard WorkerThis implementation stores information about each node in a series of arrays. Conceptually, 25*1212f9a0SAndroid Build Coastguard Workerthe arrays can be thought of as either <code>String</code> Vectors or <code>int</code> 26*1212f9a0SAndroid Build Coastguard WorkerVectors although they are implemented using some internal classes. The <code>m_chars</code> 27*1212f9a0SAndroid Build Coastguard Workerarray is conceptually a Vector of <code>chars</code>. The chief arrays of 28*1212f9a0SAndroid Build Coastguard Workerinterest are shown in the following table:</p> 29*1212f9a0SAndroid Build Coastguard Worker 30*1212f9a0SAndroid Build Coastguard Worker<table border="1" 31*1212f9a0SAndroid Build Coastguard Workersummary="Key arrays used: the first cell contains the array name and the second contains the 32*1212f9a0SAndroid Build Coastguard Worker conceptual type, and the third contains the description of the contents"> 33*1212f9a0SAndroid Build Coastguard Worker<tr> 34*1212f9a0SAndroid Build Coastguard Worker<th>Array Name</th> 35*1212f9a0SAndroid Build Coastguard Worker<th>Array Type</th> 36*1212f9a0SAndroid Build Coastguard Worker<th>Contents</th> 37*1212f9a0SAndroid Build Coastguard Worker</tr> 38*1212f9a0SAndroid Build Coastguard Worker 39*1212f9a0SAndroid Build Coastguard Worker<tr> 40*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><code>m_exptype</code></td> 41*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">int</td> 42*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">An integer representing a unique value for a Node. The first 6 43*1212f9a0SAndroid Build Coastguard Workerbits represent the Node type, as shown below. The next 10 bits represent an index 44*1212f9a0SAndroid Build Coastguard Workerinto m_namespaceNames. The remaining 16 bits represent an index into m_locNamesPool. 45*1212f9a0SAndroid Build Coastguard Worker<b>Start here.</b> This Vector represents the list of Nodes.</td> 46*1212f9a0SAndroid Build Coastguard Worker</tr> 47*1212f9a0SAndroid Build Coastguard Worker 48*1212f9a0SAndroid Build Coastguard Worker<tr> 49*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><code>m_locNamesPool</code></td> 50*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">String</td> 51*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Local (prefixed) names. Field of m_expandedNameTable.</td> 52*1212f9a0SAndroid Build Coastguard Worker</tr> 53*1212f9a0SAndroid Build Coastguard Worker 54*1212f9a0SAndroid Build Coastguard Worker<tr> 55*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><code>m_namespaceNames</code></td> 56*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">String</td> 57*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Namespace URIs. Field of m_expandedNameTable.</td> 58*1212f9a0SAndroid Build Coastguard Worker</tr> 59*1212f9a0SAndroid Build Coastguard Worker 60*1212f9a0SAndroid Build Coastguard Worker<tr> 61*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><code>m_dataOrQName</code></td> 62*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">int</td> 63*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">An index into either m_data or m_valuesOrPrefixes, as explained 64*1212f9a0SAndroid Build Coastguard Workerin the next table.</td> 65*1212f9a0SAndroid Build Coastguard Worker</tr> 66*1212f9a0SAndroid Build Coastguard Worker 67*1212f9a0SAndroid Build Coastguard Worker<tr> 68*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><code>m_valuesOrPrefixes</code></td> 69*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">String</td> 70*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Values and prefixes.</td> 71*1212f9a0SAndroid Build Coastguard Worker</tr> 72*1212f9a0SAndroid Build Coastguard Worker 73*1212f9a0SAndroid Build Coastguard Worker<tr> 74*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><code>m_data</code></td> 75*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">int</td> 76*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Entries here occur in pairs. The use of this array is explained 77*1212f9a0SAndroid Build Coastguard Workerin the next table.</td> 78*1212f9a0SAndroid Build Coastguard Worker</tr> 79*1212f9a0SAndroid Build Coastguard Worker 80*1212f9a0SAndroid Build Coastguard Worker<tr> 81*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><code>m_chars</code></td> 82*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">char</td> 83*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Characters used to form Strings as explained in the next table.</td> 84*1212f9a0SAndroid Build Coastguard Worker</tr> 85*1212f9a0SAndroid Build Coastguard Worker</table> 86*1212f9a0SAndroid Build Coastguard Worker 87*1212f9a0SAndroid Build Coastguard Worker<p>This table shows how the array values are used for each type of Node supported by 88*1212f9a0SAndroid Build Coastguard Workerthis implementation. An <i>n</i> represents an index into <code>m_namespaceNames</code> 89*1212f9a0SAndroid Build Coastguard Workerfor the namespace URI associated with the attribute or element. It actually consists 90*1212f9a0SAndroid Build Coastguard Workerof the 10 bits, including the rightmost two bits of the leftmost byte. The <i>eeee</i> 91*1212f9a0SAndroid Build Coastguard Workerrepresents an index into <code>m_locNamesPool</code> for the value indicated in the table.</p> 92*1212f9a0SAndroid Build Coastguard Worker 93*1212f9a0SAndroid Build Coastguard Worker<table border="1" 94*1212f9a0SAndroid Build Coastguard Workersummary="Node table"> 95*1212f9a0SAndroid Build Coastguard Worker<tr> 96*1212f9a0SAndroid Build Coastguard Worker<th>NodeType</th> 97*1212f9a0SAndroid Build Coastguard Worker<th>m_exptype</th> 98*1212f9a0SAndroid Build Coastguard Worker<th>m_dataOrQName</th> 99*1212f9a0SAndroid Build Coastguard Worker<th>m_data</th> 100*1212f9a0SAndroid Build Coastguard Worker</tr> 101*1212f9a0SAndroid Build Coastguard Worker 102*1212f9a0SAndroid Build Coastguard Worker<tr> 103*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Attr</td> 104*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"> 08<i>neeee</i><br>-0b<i>neeee</i><br> 105*1212f9a0SAndroid Build Coastguard Worker<i>eeee</i> is local name of attribute.</td> 106*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><b>No namespace</b>: an index into 107*1212f9a0SAndroid Build Coastguard Worker<code>m_valuesOrPrefixes</code> pointing to the attribute value. 108*1212f9a0SAndroid Build Coastguard Worker<br><b>Namespace</b>: a negative number, the absolute value of which is an index 109*1212f9a0SAndroid Build Coastguard Workerinto m_data.</td> 110*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><b>index</b>: an int containing the index into 111*1212f9a0SAndroid Build Coastguard Worker<code>m_valuesOrPrefixes</code> for the Attr QName. 112*1212f9a0SAndroid Build Coastguard Worker<br><b>index+1</b>: an int 113*1212f9a0SAndroid Build Coastguard Workercontaining the index into <code>m_valuesOrPrefixes</code> for the attribute value.</td> 114*1212f9a0SAndroid Build Coastguard Worker</tr> 115*1212f9a0SAndroid Build Coastguard Worker 116*1212f9a0SAndroid Build Coastguard Worker<tr> 117*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Comment</td> 118*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"> 20000000</td> 119*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">index into <code>m_valuesOrPrefixes</code> 120*1212f9a0SAndroid Build Coastguard Workerfor comment text.</td> 121*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">unused</td> 122*1212f9a0SAndroid Build Coastguard Worker</tr> 123*1212f9a0SAndroid Build Coastguard Worker 124*1212f9a0SAndroid Build Coastguard Worker<tr> 125*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Document</td> 126*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"> 24000000</td> 127*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">0</td> 128*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">unused</td> 129*1212f9a0SAndroid Build Coastguard Worker</tr> 130*1212f9a0SAndroid Build Coastguard Worker 131*1212f9a0SAndroid Build Coastguard Worker<tr> 132*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Element</td> 133*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"> 04<i>neeee</i><br>-07<i>neeee</i><br> 134*1212f9a0SAndroid Build Coastguard Worker<i>eeee</i> is local name of element.</td> 135*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><b>No namespace</b>: 0. 136*1212f9a0SAndroid Build Coastguard Worker<br><b>Namespace</b>: an index into 137*1212f9a0SAndroid Build Coastguard Worker<code>m_valuesOrPrefixes</code> pointing to the QName.</td> 138*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">unused</td> 139*1212f9a0SAndroid Build Coastguard Worker</tr> 140*1212f9a0SAndroid Build Coastguard Worker 141*1212f9a0SAndroid Build Coastguard Worker<tr> 142*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Text</td> 143*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"> 0C000000</td> 144*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">an index into m_data.</td> 145*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"><b>index</b>: an int containing starting subscript in 146*1212f9a0SAndroid Build Coastguard Worker<code>m_chars</code> for the text. 147*1212f9a0SAndroid Build Coastguard Worker<br><b>index+1</b>: an int 148*1212f9a0SAndroid Build Coastguard Workercontaining the length of the text.</td> 149*1212f9a0SAndroid Build Coastguard Worker 150*1212f9a0SAndroid Build Coastguard Worker<tr> 151*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">ProcessingInstruction</td> 152*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"> 1C0<i>eeee</i> 153*1212f9a0SAndroid Build Coastguard Worker<br><i>eeee</i> is the target name.</td> 154*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">index into <code>m_valuesOrPrefixes</code> 155*1212f9a0SAndroid Build Coastguard Workerfor PI data.</td> 156*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">unused</td> 157*1212f9a0SAndroid Build Coastguard Worker</tr> 158*1212f9a0SAndroid Build Coastguard Worker 159*1212f9a0SAndroid Build Coastguard Worker<tr> 160*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">Namespace</td> 161*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1"> 34<i>neeee</i><br> 162*1212f9a0SAndroid Build Coastguard Worker<i>eeee</i> is namespace prefix.</td> 163*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">index into 164*1212f9a0SAndroid Build Coastguard Worker<code>m_valuesOrPrefixes</code> pointing to the namespace URI.</td> 165*1212f9a0SAndroid Build Coastguard Worker<td rowspan="1" colspan="1">unused</td> 166*1212f9a0SAndroid Build Coastguard Worker</tr> 167*1212f9a0SAndroid Build Coastguard Worker 168*1212f9a0SAndroid Build Coastguard Worker</table> 169*1212f9a0SAndroid Build Coastguard Worker</body> 170