/** @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; }
/** Retrieve the SourceLocator associated with a specific node. * This is only meaningful if the XalanProperties.SOURCE_LOCATION flag was * set True using setProperty; if it was never set, or was set false, we * will return null. * * (We _could_ return a locator with the document's base URI and bogus * line/column information. Trying that; see the else clause.) * */ public SourceLocator getSourceLocatorFor(int node) { if (m_useSourceLocationProperty) { node = makeNodeIdentity(node); return new NodeLocator(null, m_sourceSystemId.elementAt(node), m_sourceLine.elementAt(node), m_sourceColumn.elementAt(node)); } else if(m_locator!=null) { return new NodeLocator(null,m_locator.getSystemId(),-1,-1); } else if(m_systemId!=null) { return new NodeLocator(null,m_systemId,-1,-1); } return null; }
/** Retrieve the SourceLocator associated with a specific node. * This is only meaningful if the XalanProperties.SOURCE_LOCATION flag was * set True using setProperty; if it was never set, or was set false, we * will return null. * * (We _could_ return a locator with the document's base URI and bogus * line/column information. Trying that; see the else clause.) * */ public SourceLocator getSourceLocatorFor(int node) { if (m_useSourceLocationProperty) { node = makeNodeIdentity(node); return new NodeLocator(null, m_sourceSystemId.elementAt(node), m_sourceLine.elementAt(node), m_sourceColumn.elementAt(node)); } else if(m_locator!=null) { return new NodeLocator(null,m_locator.getSystemId(),-1,-1); } else if(m_systemId!=null) { return new NodeLocator(null,m_systemId,-1,-1); } return null; }
node = m_cachedNodes.elementAt(index); return m_dtm.getNode(node); } else if (m_last == -1) {
node = m_cachedNodes.elementAt(index); return m_dtm.getNode(node); } else if (m_last == -1) {
/** @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; }
/** @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; }
/** @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; }
/** @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; }
/** @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; }
/** Retrieve the SourceLocator associated with a specific node. * This is only meaningful if the XalanProperties.SOURCE_LOCATION flag was * set True using setProperty; if it was never set, or was set false, we * will return null. * * (We _could_ return a locator with the document's base URI and bogus * line/column information. Trying that; see the else clause.) * */ public SourceLocator getSourceLocatorFor(int node) { if (m_useSourceLocationProperty) { node = makeNodeIdentity(node); return new NodeLocator(null, m_sourceSystemId.elementAt(node), m_sourceLine.elementAt(node), m_sourceColumn.elementAt(node)); } else if(m_locator!=null) { return new NodeLocator(null,m_locator.getSystemId(),-1,-1); } else if(m_systemId!=null) { return new NodeLocator(null,m_systemId,-1,-1); } return null; }
/** Retrieve the SourceLocator associated with a specific node. * This is only meaningful if the XalanProperties.SOURCE_LOCATION flag was * set True using setProperty; if it was never set, or was set false, we * will return null. * * (We _could_ return a locator with the document's base URI and bogus * line/column information. Trying that; see the else clause.) * */ public SourceLocator getSourceLocatorFor(int node) { if (m_useSourceLocationProperty) { node = makeNodeIdentity(node); return new NodeLocator(null, m_sourceSystemId.elementAt(node), m_sourceLine.elementAt(node), m_sourceColumn.elementAt(node)); } else if(m_locator!=null) { return new NodeLocator(null,m_locator.getSystemId(),-1,-1); } else if(m_systemId!=null) { return new NodeLocator(null,m_systemId,-1,-1); } return null; }
/** Retrieve the SourceLocator associated with a specific node. * This is only meaningful if the XalanProperties.SOURCE_LOCATION flag was * set True using setProperty; if it was never set, or was set false, we * will return null. * * (We _could_ return a locator with the document's base URI and bogus * line/column information. Trying that; see the else clause.) * */ public SourceLocator getSourceLocatorFor(int node) { if (m_useSourceLocationProperty) { node = makeNodeIdentity(node); return new NodeLocator(null, m_sourceSystemId.elementAt(node), m_sourceLine.elementAt(node), m_sourceColumn.elementAt(node)); } else if(m_locator!=null) { return new NodeLocator(null,m_locator.getSystemId(),-1,-1); } else if(m_systemId!=null) { return new NodeLocator(null,m_systemId,-1,-1); } return null; }
/** Retrieve the SourceLocator associated with a specific node. * This is only meaningful if the XalanProperties.SOURCE_LOCATION flag was * set True using setProperty; if it was never set, or was set false, we * will return null. * * (We _could_ return a locator with the document's base URI and bogus * line/column information. Trying that; see the else clause.) * */ public SourceLocator getSourceLocatorFor(int node) { if (m_useSourceLocationProperty) { node = makeNodeIdentity(node); return new NodeLocator(null, m_sourceSystemId.elementAt(node), m_sourceLine.elementAt(node), m_sourceColumn.elementAt(node)); } else if(m_locator!=null) { return new NodeLocator(null,m_locator.getSystemId(),-1,-1); } else if(m_systemId!=null) { return new NodeLocator(null,m_systemId,-1,-1); } return null; }
node = m_cachedNodes.elementAt(index); return m_dtm.getNode(node); } else if (m_last == -1) {