/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
/** @return integer index uniquely identifying the value of this string. */ public int stringToIndex(String s) { if(s==null) return NULL; int hashslot=s.hashCode()%HASHPRIME; if(hashslot<0) hashslot=-hashslot; // Is it one we already know? int hashlast=m_hashStart[hashslot]; int hashcandidate=hashlast; while(hashcandidate!=NULL) { if(m_intToString.elementAt(hashcandidate).equals(s)) return hashcandidate; hashlast=hashcandidate; hashcandidate=m_hashChain.elementAt(hashcandidate); } // New value. Add to tables. int newIndex=m_intToString.size(); m_intToString.addElement(s); m_hashChain.addElement(NULL); // Initialize to no-following-same-hash if(hashlast==NULL) // First for this hash m_hashStart[hashslot]=newIndex; else // Link from previous with same hash m_hashChain.setElementAt(newIndex,hashlast); return newIndex; }
/** @return integer index uniquely identifying the value of this string. */ public int stringToIndex(String s) { if(s==null) return NULL; int hashslot=s.hashCode()%HASHPRIME; if(hashslot<0) hashslot=-hashslot; // Is it one we already know? int hashlast=m_hashStart[hashslot]; int hashcandidate=hashlast; while(hashcandidate!=NULL) { if(m_intToString.elementAt(hashcandidate).equals(s)) return hashcandidate; hashlast=hashcandidate; hashcandidate=m_hashChain.elementAt(hashcandidate); } // New value. Add to tables. int newIndex=m_intToString.size(); m_intToString.addElement(s); m_hashChain.addElement(NULL); // Initialize to no-following-same-hash if(hashlast==NULL) // First for this hash m_hashStart[hashslot]=newIndex; else // Link from previous with same hash m_hashChain.setElementAt(newIndex,hashlast); return newIndex; }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
while (((node = m_iter.next()) != DTMAxisIterator.END) && count <= index) { m_cachedNodes.addElement(node); count++;
while (((node = m_iter.next()) != DTMAxisIterator.END) && count <= index) { m_cachedNodes.addElement(node); count++;
/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { if (m_last == -1) { int node; while ((node = m_iter.next()) != DTMAxisIterator.END) { m_cachedNodes.addElement(node); } m_last = m_cachedNodes.size(); } return m_last; } }