code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
833 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public int getLastChild(int nodeHandle) { // ###shs put trace/debug later nodeHandle &= NODEHANDLE_MASK; // do not need to test node type since getFirstChild does that int lastChild = NULL; for (int nextkid = getFirstChild(nodeHandle); nextkid != NULL; nextkid = getNextSibling(nextkid)) { lastChild = nextkid; } return lastChild | m_docHandle; }
Given a node handle, advance to its last child. If not yet resolved, waits for more nodes to be added to the document and tries again. @param nodeHandle int Handle of the node. @return int Node-number of last child, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getLastChild
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getAttributeNode(int nodeHandle, String namespaceURI, String name) { int nsIndex = m_nsNames.stringToIndex(namespaceURI), nameIndex = m_localNames.stringToIndex(name); nodeHandle &= NODEHANDLE_MASK; nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); // If nodeHandle points to element next slot would be first attribute if (type == ELEMENT_NODE) nodeHandle++; // Iterate through Attribute Nodes while (type == ATTRIBUTE_NODE) { if ((nsIndex == (gotslot[0] << 16)) && (gotslot[3] == nameIndex)) return nodeHandle | m_docHandle; // Goto next sibling nodeHandle = gotslot[2]; nodes.readSlot(nodeHandle, gotslot); } return NULL; }
Retrieves an attribute node by by qualified name and namespace URI. @param nodeHandle int Handle of the node upon which to look up this attribute. @param namespaceURI The namespace URI of the attribute to retrieve, or null. @param name The local name of the attribute to retrieve. @return The attribute node handle with the specified name ( <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such attribute.
DTMDocumentImpl::getAttributeNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getFirstAttribute(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; // %REVIEW% jjk: Just a quick observation: If you're going to // call readEntry repeatedly on the same node, it may be // more efficiently to do a readSlot to get the data locally, // reducing the addressing and call-and-return overhead. // Should we check if handle is element (do we want sanity checks?) if (ELEMENT_NODE != (nodes.readEntry(nodeHandle, 0) & 0xFFFF)) return NULL; // First Attribute (if any) should be at next position in table nodeHandle++; return(ATTRIBUTE_NODE == (nodes.readEntry(nodeHandle, 0) & 0xFFFF)) ? nodeHandle | m_docHandle : NULL; }
Given a node handle, get the index of the node's first attribute. @param nodeHandle int Handle of the Element node. @return Handle of first attribute, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getFirstAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getFirstNamespaceNode(int nodeHandle, boolean inScope) { return NULL; }
Given a node handle, get the index of the node's first child. If not yet resolved, waits for more nodes to be added to the document and tries again @param nodeHandle handle to node, which should probably be an element node, but need not be. @param inScope true if all namespaces in scope should be returned, false if only the namespace declarations should be returned. @return handle of first namespace, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getFirstNamespaceNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getNextSibling(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; // Document root has no next sibling if (nodeHandle == 0) return NULL; short type = (short) (nodes.readEntry(nodeHandle, 0) & 0xFFFF); if ((type == ELEMENT_NODE) || (type == ATTRIBUTE_NODE) || (type == ENTITY_REFERENCE_NODE)) { int nextSib = nodes.readEntry(nodeHandle, 2); if (nextSib == NULL) return NULL; if (nextSib != 0) return (m_docHandle | nextSib); // ###shs should cycle/wait if nextSib is 0? Working on threading next } // Next Sibling is in the next position if it shares the same parent int thisParent = nodes.readEntry(nodeHandle, 1); if (nodes.readEntry(++nodeHandle, 1) == thisParent) return (m_docHandle | nodeHandle); return NULL; }
Given a node handle, advance to its next sibling. %TBD% This currently uses the DTM-internal definition of sibling; eg, the last attr's next sib is the first child. In the old DTM, the DOM proxy layer provided the additional logic for the public view. If we're rewriting for XPath emulation, that test must be done here. %TBD% CODE INTERACTION WITH INCREMENTAL PARSE - If not yet resolved, should wait for more nodes to be added to the document and tries again. @param nodeHandle int Handle of the node. @return int Node-number of next sibling, or DTM.NULL to indicate none exists. *
DTMDocumentImpl::getNextSibling
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getPreviousSibling(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; // Document root has no previous sibling if (nodeHandle == 0) return NULL; int parent = nodes.readEntry(nodeHandle, 1); int kid = NULL; for (int nextkid = getFirstChild(parent); nextkid != nodeHandle; nextkid = getNextSibling(nextkid)) { kid = nextkid; } return kid | m_docHandle; }
Given a node handle, find its preceeding sibling. WARNING: DTM is asymmetric; this operation is resolved by search, and is relatively expensive. @param nodeHandle the id of the node. @return int Node-number of the previous sib, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getPreviousSibling
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getNextAttribute(int nodeHandle) { nodeHandle &= NODEHANDLE_MASK; nodes.readSlot(nodeHandle, gotslot); //%REVIEW% Why are we using short here? There's no storage //reduction for an automatic variable, especially one used //so briefly, and it typically costs more cycles to process //than an int would. short type = (short) (gotslot[0] & 0xFFFF); if (type == ELEMENT_NODE) { return getFirstAttribute(nodeHandle); } else if (type == ATTRIBUTE_NODE) { if (gotslot[2] != NULL) return (m_docHandle | gotslot[2]); } return NULL; }
Given a node handle, advance to the next attribute. If an element, we advance to its first attribute; if an attr, we advance to the next attr on the same node. @param nodeHandle int Handle of the node. @return int DTM node-number of the resolved attr, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getNextAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getNextNamespaceNode(int baseHandle,int namespaceHandle, boolean inScope) { // ###shs need to work on namespace return NULL; }
Given a namespace handle, advance to the next namespace. %TBD% THIS METHOD DOES NOT MATCH THE CURRENT SIGNATURE IN THE DTM INTERFACE. FIX IT, OR JUSTIFY CHANGING THE DTM API. @param namespaceHandle handle to node which must be of type NAMESPACE_NODE. @return handle of next namespace, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getNextNamespaceNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getNextDescendant(int subtreeRootHandle, int nodeHandle) { subtreeRootHandle &= NODEHANDLE_MASK; nodeHandle &= NODEHANDLE_MASK; // Document root [Document Node? -- jjk] - no next-sib if (nodeHandle == 0) return NULL; while (!m_isError) { // Document done and node out of bounds if (done && (nodeHandle > nodes.slotsUsed())) break; if (nodeHandle > subtreeRootHandle) { nodes.readSlot(nodeHandle+1, gotslot); if (gotslot[2] != 0) { short type = (short) (gotslot[0] & 0xFFFF); if (type == ATTRIBUTE_NODE) { nodeHandle +=2; } else { int nextParentPos = gotslot[1]; if (nextParentPos >= subtreeRootHandle) return (m_docHandle | (nodeHandle+1)); else break; } } else if (!done) { // Add wait logic here } else break; } else { nodeHandle++; } } // Probably should throw error here like original instead of returning return NULL; }
Given a node handle, advance to its next descendant. If not yet resolved, waits for more nodes to be added to the document and tries again. @param subtreeRootHandle @param nodeHandle int Handle of the node. @return handle of next descendant, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getNextDescendant
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getNextFollowing(int axisContextHandle, int nodeHandle) { //###shs still working on return NULL; }
Given a node handle, advance to the next node on the following axis. @param axisContextHandle the start of the axis that is being traversed. @param nodeHandle @return handle of next sibling, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getNextFollowing
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getNextPreceding(int axisContextHandle, int nodeHandle) { // ###shs copied from Xalan 1, what is this suppose to do? nodeHandle &= NODEHANDLE_MASK; while (nodeHandle > 1) { nodeHandle--; if (ATTRIBUTE_NODE == (nodes.readEntry(nodeHandle, 0) & 0xFFFF)) continue; // if nodeHandle is _not_ an ancestor of // axisContextHandle, specialFind will return it. // If it _is_ an ancestor, specialFind will return -1 // %REVIEW% unconditional return defeats the // purpose of the while loop -- does this // logic make any sense? return (m_docHandle | nodes.specialFind(axisContextHandle, nodeHandle)); } return NULL; }
Given a node handle, advance to the next node on the preceding axis. @param axisContextHandle the start of the axis that is being traversed. @param nodeHandle the id of the node. @return int Node-number of preceding sibling, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getNextPreceding
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getParent(int nodeHandle) { // Should check to see within range? // Document Root should not have to be handled differently return (m_docHandle | nodes.readEntry(nodeHandle, 1)); }
Given a node handle, find its parent node. @param nodeHandle the id of the node. @return int Node-number of parent, or DTM.NULL to indicate none exists.
DTMDocumentImpl::getParent
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getDocumentRoot() { return (m_docHandle | m_docElement); }
Returns the root element of the document. @return nodeHandle to the Document Root.
DTMDocumentImpl::getDocumentRoot
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getDocument() { return m_docHandle; }
Given a node handle, find the owning document node. @return int Node handle of document, which should always be valid.
DTMDocumentImpl::getDocument
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getOwnerDocument(int nodeHandle) { // Assumption that Document Node is always in 0 slot if ((nodeHandle & NODEHANDLE_MASK) == 0) return NULL; return (nodeHandle & DOCHANDLE_MASK); }
Given a node handle, find the owning document node. This has the exact same semantics as the DOM Document method of the same name, in that if the nodeHandle is a document node, it will return NULL. <p>%REVIEW% Since this is DOM-specific, it may belong at the DOM binding layer. Included here as a convenience function and to aid porting of DOM code to DTM.</p> @param nodeHandle the id of the node. @return int Node handle of owning document, or NULL if the nodeHandle is a document.
DTMDocumentImpl::getOwnerDocument
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getDocumentRoot(int nodeHandle) { // Assumption that Document Node is always in 0 slot if ((nodeHandle & NODEHANDLE_MASK) == 0) return NULL; return (nodeHandle & DOCHANDLE_MASK); }
Given a node handle, find the owning document node. This has the DTM semantics; a Document node is its own owner. <p>%REVIEW% Since this is DOM-specific, it may belong at the DOM binding layer. Included here as a convenience function and to aid porting of DOM code to DTM.</p> @param nodeHandle the id of the node. @return int Node handle of owning document, or NULL if the nodeHandle is a document.
DTMDocumentImpl::getDocumentRoot
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getExpandedTypeID(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); String qName = m_localNames.indexToString(gotslot[3]); // Remove prefix from qName // %TBD% jjk This is assuming the elementName is the qName. int colonpos = qName.indexOf(":"); String localName = qName.substring(colonpos+1); // Get NS String namespace = m_nsNames.indexToString(gotslot[0] << 16); // Create expanded name String expandedName = namespace + ":" + localName; int expandedNameID = m_nsNames.stringToIndex(expandedName); return expandedNameID; }
Given a node handle, return an ID that represents the node's expanded name. @param nodeHandle The handle to the node in question. @return the expanded-name id of the node.
DTMDocumentImpl::getExpandedTypeID
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public int getExpandedTypeID(String namespace, String localName, int type) { // Create expanded name // %TBD% jjk Expanded name is bitfield-encoded as // typeID[6]nsuriID[10]localID[16]. Switch to that form, and to // accessing the ns/local via their tables rather than confusing // nsnames and expandednames. String expandedName = namespace + ":" + localName; int expandedNameID = m_nsNames.stringToIndex(expandedName); return expandedNameID; }
Given an expanded name, return an ID. If the expanded-name does not exist in the internal tables, the entry will be created, and the ID will be returned. Any additional nodes that are created that have this expanded name will use this ID. @return the expanded-name id of the node.
DTMDocumentImpl::getExpandedTypeID
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getLocalNameFromExpandedNameID(int ExpandedNameID) { // Get expanded name String expandedName = m_localNames.indexToString(ExpandedNameID); // Remove prefix from expanded name int colonpos = expandedName.indexOf(":"); String localName = expandedName.substring(colonpos+1); return localName; }
Given an expanded-name ID, return the local name part. @param ExpandedNameID an ID that represents an expanded-name. @return String Local name of this node.
DTMDocumentImpl::getLocalNameFromExpandedNameID
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getNamespaceFromExpandedNameID(int ExpandedNameID) { String expandedName = m_localNames.indexToString(ExpandedNameID); // Remove local name from expanded name int colonpos = expandedName.indexOf(":"); String nsName = expandedName.substring(0, colonpos); return nsName; }
Given an expanded-name ID, return the namespace URI part. @param ExpandedNameID an ID that represents an expanded-name. @return String URI value of this node's namespace, or null if no namespace was resolved.
DTMDocumentImpl::getNamespaceFromExpandedNameID
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getNodeName(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); String name = fixednames[type]; if (null == name) { int i=gotslot[3]; /**/System.out.println("got i="+i+" "+(i>>16)+"/"+(i&0xffff)); name=m_localNames.indexToString(i & 0xFFFF); String prefix=m_prefixNames.indexToString(i >>16); if(prefix!=null && prefix.length()>0) name=prefix+":"+name; } return name; }
Given a node handle, return its DOM-style node name. This will include names such as #text or #document. @param nodeHandle the id of the node. @return String Name of this node, which may be an empty string. %REVIEW% Document when empty string is possible...
DTMDocumentImpl::getNodeName
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getNodeNameX(int nodeHandle) {return null;}
Given a node handle, return the XPath node name. This should be the name as described by the XPath data model, NOT the DOM-style name. @param nodeHandle the id of the node. @return String Name of this node.
DTMDocumentImpl::getNodeNameX
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getLocalName(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); String name = ""; if ((type==ELEMENT_NODE) || (type==ATTRIBUTE_NODE)) { int i=gotslot[3]; name=m_localNames.indexToString(i & 0xFFFF); if(name==null) name=""; } return name; }
Given a node handle, return its DOM-style localname. (As defined in Namespaces, this is the portion of the name after any colon character) %REVIEW% What's the local name of something other than Element/Attr? Should this be DOM-style (undefined unless namespaced), or other? @param nodeHandle the id of the node. @return String Local name of this node.
DTMDocumentImpl::getLocalName
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getPrefix(int nodeHandle) { nodes.readSlot(nodeHandle, gotslot); short type = (short) (gotslot[0] & 0xFFFF); String name = ""; if((type==ELEMENT_NODE) || (type==ATTRIBUTE_NODE)) { int i=gotslot[3]; name=m_prefixNames.indexToString(i >>16); if(name==null) name=""; } return name; }
Given a namespace handle, return the prefix that the namespace decl is mapping. Given a node handle, return the prefix used to map to the namespace. <p> %REVIEW% Are you sure you want "" for no prefix? </p> %REVIEW% Should this be DOM-style (undefined unless namespaced), or other? @param nodeHandle the id of the node. @return String prefix of this node's name, or "" if no explicit namespace prefix was given.
DTMDocumentImpl::getPrefix
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getNamespaceURI(int nodeHandle) {return null;}
Given a node handle, return its DOM-style namespace URI (As defined in Namespaces, this is the declared URI which this node's prefix -- or default in lieu thereof -- was mapped to.) @param nodeHandle the id of the node. @return String URI value of this node's namespace, or null if no namespace was resolved.
DTMDocumentImpl::getNamespaceURI
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public short getNodeType(int nodeHandle) { return(short) (nodes.readEntry(nodeHandle, 0) & 0xFFFF); }
Given a node handle, return its DOM-style node type. <p> %REVIEW% Generally, returning short is false economy. Return int? @param nodeHandle The node id. @return int Node type, as per the DOM's Node._NODE constants.
DTMDocumentImpl::getNodeType
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public short getLevel(int nodeHandle) { short count = 0; while (nodeHandle != 0) { count++; nodeHandle = nodes.readEntry(nodeHandle, 1); } return count; }
Get the depth level of this node in the tree (equals 1 for a parentless node). @param nodeHandle The node id. @return the number of ancestors, plus one @xsl.usage internal
DTMDocumentImpl::getLevel
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public boolean isSupported(String feature, String version) {return false;}
Tests whether DTM DOM implementation implements a specific feature and that feature is supported by this node. @param feature The name of the feature to test. @param version This is the version number of the feature to test. If the version is not specified, supporting any version of the feature will cause the method to return <code>true</code>. @return Returns <code>true</code> if the specified feature is supported on this node, <code>false</code> otherwise.
DTMDocumentImpl::isSupported
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getDocumentBaseURI() { return m_documentBaseURI; }
Return the base URI of the document entity. If it is not known (because the document was parsed from a socket connection or from standard input, for example), the value of this property is unknown. @return the document base URI String object or null if unknown.
DTMDocumentImpl::getDocumentBaseURI
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public void setDocumentBaseURI(String baseURI) { m_documentBaseURI = baseURI; }
Set the base URI of the document entity. @param baseURI the document base URI String object or null if unknown.
DTMDocumentImpl::setDocumentBaseURI
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getDocumentSystemIdentifier(int nodeHandle) {return null;}
Return the system identifier of the document entity. If it is not known, the value of this property is unknown. @param nodeHandle The node id, which can be any valid node handle. @return the system identifier String object or null if unknown.
DTMDocumentImpl::getDocumentSystemIdentifier
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getDocumentEncoding(int nodeHandle) {return null;}
Return the name of the character encoding scheme in which the document entity is expressed. @param nodeHandle The node id, which can be any valid node handle. @return the document encoding String object.
DTMDocumentImpl::getDocumentEncoding
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getDocumentStandalone(int nodeHandle) {return null;}
Return an indication of the standalone status of the document, either "yes" or "no". This property is derived from the optional standalone document declaration in the XML declaration at the beginning of the document entity, and has no value if there is no standalone document declaration. @param nodeHandle The node id, which can be any valid node handle. @return the document standalone String object, either "yes", "no", or null.
DTMDocumentImpl::getDocumentStandalone
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public String getDocumentVersion(int documentHandle) {return null;}
Return a string representing the XML version of the document. This property is derived from the XML declaration optionally present at the beginning of the document entity, and has no value if there is no XML declaration. @param documentHandle the document handle @return the document version String object
DTMDocumentImpl::getDocumentVersion
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public boolean getDocumentAllDeclarationsProcessed() {return false;}
Return an indication of whether the processor has read the complete DTD. Its value is a boolean. If it is false, then certain properties (indicated in their descriptions below) may be unknown. If it is true, those properties are never unknown. @return <code>true</code> if all declarations were processed {}; <code>false</code> otherwise.
DTMDocumentImpl::getDocumentAllDeclarationsProcessed
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public boolean supportsPreStripping() {return false;}
Return true if the xsl:strip-space or xsl:preserve-space was processed during construction of the DTM document. <p>%REVEIW% Presumes a 1:1 mapping from DTM to Document, since we aren't saying which Document to query...?</p>
DTMDocumentImpl::supportsPreStripping
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public boolean isNodeAfter(int nodeHandle1, int nodeHandle2) {return false;}
Figure out whether nodeHandle2 should be considered as being later in the document than nodeHandle1, in Document Order as defined by the XPath model. This may not agree with the ordering defined by other XML applications. <p> There are some cases where ordering isn't defined, and neither are the results of this function -- though we'll generally return true. TODO: Make sure this does the right thing with attribute nodes!!! @param nodeHandle1 DOM Node to perform position comparison on. @param nodeHandle2 DOM Node to perform position comparison on . @return false if node2 comes before node1, otherwise return true. You can think of this as <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
DTMDocumentImpl::isNodeAfter
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public boolean isCharacterElementContentWhitespace(int nodeHandle) {return false;}
2. [element content whitespace] A boolean indicating whether the character is white space appearing within element content (see [XML], 2.10 "White Space Handling"). Note that validating XML processors are required by XML 1.0 to provide this information. If there is no declaration for the containing element, this property has no value for white space characters. If no declaration has been read, but the [all declarations processed] property of the document information item is false (so there may be an unread declaration), then the value of this property is unknown for white space characters. It is always false for characters that are not white space. @param nodeHandle the node ID. @return <code>true</code> if the character data is whitespace; <code>false</code> otherwise.
DTMDocumentImpl::isCharacterElementContentWhitespace
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public boolean isDocumentAllDeclarationsProcessed(int documentHandle) {return false;}
10. [all declarations processed] This property is not strictly speaking part of the infoset of the document. Rather it is an indication of whether the processor has read the complete DTD. Its value is a boolean. If it is false, then certain properties (indicated in their descriptions below) may be unknown. If it is true, those properties are never unknown. @param documentHandle A node handle that must identify a document. @return <code>true</code> if all declarations were processed; <code>false</code> otherwise.
DTMDocumentImpl::isDocumentAllDeclarationsProcessed
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public void appendChild(int newChild, boolean clone, boolean cloneDepth) { boolean sameDoc = ((newChild & DOCHANDLE_MASK) == m_docHandle); if (clone || !sameDoc) { } else { } }
Append a child to the end of the child list of the current node. Please note that the node is always cloned if it is owned by another document. <p>%REVIEW% "End of the document" needs to be defined more clearly. Does it become the last child of the Document? Of the root element?</p> @param newChild Must be a valid new node handle. @param clone true if the child should be cloned into the document. @param cloneDepth if the clone argument is true, specifies that the clone should include all it's children.
DTMDocumentImpl::appendChild
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public void appendTextChild(String str) { // ###shs Think more about how this differs from createTextNode //%TBD% }
Append a text node child that will be constructed from a string, to the end of the document. <p>%REVIEW% "End of the document" needs to be defined more clearly. Does it become the last child of the Document? Of the root element?</p> @param str Non-null reference to a string.
DTMDocumentImpl::appendTextChild
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
void appendTextChild(int m_char_current_start,int contentLength) { // create a Text Node // %TBD% may be possible to combine with appendNode()to replace the next chunk of code int w0 = TEXT_NODE; // W1: Parent int w1 = currentParent; // W2: Start position within m_char int w2 = m_char_current_start; // W3: Length of the full string int w3 = contentLength; int ourslot = appendNode(w0, w1, w2, w3); previousSibling = ourslot; }
Append a text child at the current insertion point. Assumes that the actual content of the text has previously been appended to the m_char buffer (shared with the builder). @param m_char_current_start int Starting offset of node's content in m_char. @param contentLength int Length of node's content in m_char. *
DTMDocumentImpl::appendTextChild
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
void appendComment(int m_char_current_start,int contentLength) { // create a Comment Node // %TBD% may be possible to combine with appendNode()to replace the next chunk of code int w0 = COMMENT_NODE; // W1: Parent int w1 = currentParent; // W2: Start position within m_char int w2 = m_char_current_start; // W3: Length of the full string int w3 = contentLength; int ourslot = appendNode(w0, w1, w2, w3); previousSibling = ourslot; }
Append a comment child at the current insertion point. Assumes that the actual content of the comment has previously been appended to the m_char buffer (shared with the builder). @param m_char_current_start int Starting offset of node's content in m_char. @param contentLength int Length of node's content in m_char. *
DTMDocumentImpl::appendComment
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
void appendStartElement(int namespaceIndex,int localNameIndex, int prefixIndex) { // do document root node creation here on the first element, create nodes for // this element and its attributes, store the element, namespace, and attritute // name indexes to the nodes array, keep track of the current node and parent // element used // W0 High: Namespace Low: Node Type int w0 = (namespaceIndex << 16) | ELEMENT_NODE; // W1: Parent int w1 = currentParent; // W2: Next (initialized as 0) int w2 = 0; // W3: Tagname high: prefix Low: local name int w3 = localNameIndex | prefixIndex<<16; /**/System.out.println("set w3="+w3+" "+(w3>>16)+"/"+(w3&0xffff)); //int ourslot = nodes.appendSlot(w0, w1, w2, w3); int ourslot = appendNode(w0, w1, w2, w3); currentParent = ourslot; previousSibling = 0; // set the root element pointer when creating the first element node if (m_docElement == NULL) m_docElement = ourslot; }
Append an Element child at the current insertion point. This Element then _becomes_ the insertion point; subsequent appends become its lastChild until an appendEndElement() call is made. Assumes that the symbols (local name, namespace URI and prefix) have already been added to the pools Note that this _only_ handles the Element node itself. Attrs and namespace nodes are unbundled in the ContentHandler layer and appended separately. @param namespaceIndex: Index within the namespaceURI string pool @param localNameIndex Index within the local name string pool @param prefixIndex: Index within the prefix string pool *
DTMDocumentImpl::appendStartElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
void appendNSDeclaration(int prefixIndex, int namespaceIndex, boolean isID) { // %REVIEW% I'm assigning this node the "namespace for namespaces" // which the DOM defined. It is expected that the Namespace spec will // adopt this as official. It isn't strictly needed since it's implied // by the nodetype, but for now... // %REVIEW% Prefix need not be recorded; it's implied too. But // recording it might simplify the design. // %TBD% isID is not currently honored. final int namespaceForNamespaces=m_nsNames.stringToIndex("http://www.w3.org/2000/xmlns/"); // W0 High: Namespace Low: Node Type int w0 = NAMESPACE_NODE | (m_nsNames.stringToIndex("http://www.w3.org/2000/xmlns/")<<16); // W1: Parent int w1 = currentParent; // W2: CURRENTLY UNUSED -- It's next-sib in attrs, but we have no kids. int w2 = 0; // W3: namespace name int w3 = namespaceIndex; // Add node int ourslot = appendNode(w0, w1, w2, w3); previousSibling = ourslot; // Should attributes be previous siblings previousSiblingWasParent = false; return ;//(m_docHandle | ourslot); }
Append a Namespace Declaration child at the current insertion point. Assumes that the symbols (namespace URI and prefix) have already been added to the pools @param prefixIndex: Index within the prefix string pool @param namespaceIndex: Index within the namespaceURI string pool @param isID: If someone really insists on writing a bad DTD, it is theoretically possible for a namespace declaration to also be declared as being a node ID. I don't really want to support that stupidity, but I'm not sure we can refuse to accept it. *
DTMDocumentImpl::appendNSDeclaration
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
void appendAttribute(int namespaceIndex, int localNameIndex, int prefixIndex, boolean isID, int m_char_current_start, int contentLength) { // %TBD% isID is not currently honored. // W0 High: Namespace Low: Node Type int w0 = ATTRIBUTE_NODE | namespaceIndex<<16; // W1: Parent int w1 = currentParent; // W2: Next (not yet resolved) int w2 = 0; // W3: Tagname high: prefix Low: local name int w3 = localNameIndex | prefixIndex<<16; /**/System.out.println("set w3="+w3+" "+(w3>>16)+"/"+(w3&0xffff)); // Add node int ourslot = appendNode(w0, w1, w2, w3); previousSibling = ourslot; // Should attributes be previous siblings // Attribute's content is currently appended as a Text Node // W0: Node Type w0 = TEXT_NODE; // W1: Parent w1 = ourslot; // W2: Start Position within buffer w2 = m_char_current_start; // W3: Length w3 = contentLength; appendNode(w0, w1, w2, w3); // Attrs are Parents previousSiblingWasParent = true; return ;//(m_docHandle | ourslot); }
Append an Attribute child at the current insertion point. Assumes that the symbols (namespace URI, local name, and prefix) have already been added to the pools, and that the content has already been appended to m_char. Note that the attribute's content has been flattened into a single string; DTM does _NOT_ attempt to model the details of entity references within attribute values. @param namespaceIndex int Index within the namespaceURI string pool @param localNameIndex int Index within the local name string pool @param prefixIndex int Index within the prefix string pool @param isID boolean True if this attribute was declared as an ID (for use in supporting getElementByID). @param m_char_current_start int Starting offset of node's content in m_char. @param contentLength int Length of node's content in m_char. *
DTMDocumentImpl::appendAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public DTMAxisTraverser getAxisTraverser(final int axis) { return null; }
This returns a stateless "traverser", that can navigate over an XPath axis, though not in document order. @param axis One of Axes.ANCESTORORSELF, etc. @return A DTMAxisIterator, or null if the given axis isn't supported.
DTMDocumentImpl::getAxisTraverser
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public DTMAxisIterator getAxisIterator(final int axis) { // %TBD% return null; }
This is a shortcut to the iterators that implement the supported XPath axes (only namespace::) is not supported. Returns a bare-bones iterator that must be initialized with a start node (using iterator.setStartNode()). @param axis One of Axes.ANCESTORORSELF, etc. @return A DTMAxisIterator, or null if the given axis isn't supported.
DTMDocumentImpl::getAxisIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public DTMAxisIterator getTypedAxisIterator(final int axis, final int type) { // %TBD% return null; }
Get an iterator that can navigate over an XPath Axis, predicated by the extended type ID. @param axis @param type An extended type ID. @return A DTMAxisIterator, or null if the given axis isn't supported.
DTMDocumentImpl::getTypedAxisIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
void appendEndElement() { // pop up the stacks if (previousSiblingWasParent) nodes.writeEntry(previousSibling, 2, NULL); // Pop parentage previousSibling = currentParent; nodes.readSlot(currentParent, gotslot); currentParent = gotslot[1] & 0xFFFF; // The element just being finished will be // the previous sibling for the next operation previousSiblingWasParent = true; // Pop a level of namespace table // namespaceTable.removeLastElem(); }
Terminate the element currently acting as an insertion point. Subsequent insertions will occur as the last child of this element's parent. *
DTMDocumentImpl::appendEndElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
void appendStartDocument() { // %TBD% reset slot 0 to indicate ChunkedIntArray reuse or wait for // the next initDocument(). m_docElement = NULL; // reset nodeHandle to the root of the actual dtm doc content initDocument(0); }
Starting a new document. Perform any resets/initialization not already handled. *
DTMDocumentImpl::appendStartDocument
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
void appendEndDocument() { done = true; // %TBD% may need to notice the last slot number and slot count to avoid // residual data from provious use of this DTM }
All appends to this document have finished; do whatever final cleanup is needed. *
DTMDocumentImpl::appendEndDocument
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public void documentRegistration() { }
A dummy routine to satisify the abstract interface. If the DTM implememtation that extends the default base requires notification of registration, they can override this method.
DTMDocumentImpl::documentRegistration
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public void documentRelease() { }
A dummy routine to satisify the abstract interface. If the DTM implememtation that extends the default base requires notification when the document is being released, they can override this method
DTMDocumentImpl::documentRelease
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
public void migrateTo(DTMManager manager) { }
Migrate a DTM built with an old DTMManager to a new DTMManager. After the migration, the new DTMManager will treat the DTM as one that is built by itself. This is used to support DTM sharing between multiple transformations. @param manager the DTMManager
DTMDocumentImpl::migrateTo
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
Apache-2.0
ChunkedIntArray(int slotsize) { if(this.slotsize<slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CHUNKEDINTARRAY_NOT_SUPPORTED, new Object[]{Integer.toString(slotsize)})); //"ChunkedIntArray("+slotsize+") not currently supported"); else if (this.slotsize>slotsize) System.out.println("*****WARNING: ChunkedIntArray("+slotsize+") wasting "+(this.slotsize-slotsize)+" words per slot"); chunks.addElement(fastArray); }
Create a new CIA with specified record size. Currently record size MUST be a power of two... and in fact is hardcoded to 4.
ChunkedIntArray::ChunkedIntArray
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
Apache-2.0
int appendSlot(int w0, int w1, int w2, int w3) { /* try { int newoffset = (lastUsed+1)*slotsize; fastArray[newoffset] = w0; fastArray[newoffset+1] = w1; fastArray[newoffset+2] = w2; fastArray[newoffset+3] = w3; return ++lastUsed; } catch(ArrayIndexOutOfBoundsException aioobe) */ { final int slotsize=4; int newoffset = (lastUsed+1)*slotsize; int chunkpos = newoffset >> lowbits; int slotpos = (newoffset & lowmask); // Grow if needed if (chunkpos > chunks.size() - 1) chunks.addElement(new int[chunkalloc]); int[] chunk = chunks.elementAt(chunkpos); chunk[slotpos] = w0; chunk[slotpos+1] = w1; chunk[slotpos+2] = w2; chunk[slotpos+3] = w3; return ++lastUsed; } }
Append a 4-integer record to the CIA, starting with record 1. (Since arrays are initialized to all-0, 0 has been reserved as the "unknown" value in DTM.) @return the index at which this record was inserted.
ChunkedIntArray::appendSlot
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
Apache-2.0
int readEntry(int position, int offset) throws ArrayIndexOutOfBoundsException { /* try { return fastArray[(position*slotsize)+offset]; } catch(ArrayIndexOutOfBoundsException aioobe) */ { // System.out.println("Using slow read (1)"); if (offset>=slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); return chunk[slotpos + offset]; } }
Retrieve an integer from the CIA by record number and column within the record, both 0-based (though position 0 is reserved for special purposes). @param position int Record number @param slotpos int Column number
ChunkedIntArray::readEntry
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
Apache-2.0
int slotsUsed() { return lastUsed; }
@return int index of highest-numbered record currently in use
ChunkedIntArray::slotsUsed
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
Apache-2.0
void discardLast() { --lastUsed; }
Disard the highest-numbered record. This is used in the string-buffer CIA; when only a single characters() chunk has been recieved, its index is moved into the Text node rather than being referenced by indirection into the text accumulator.
ChunkedIntArray::discardLast
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
Apache-2.0
void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException { /* try { fastArray[( position*slotsize)+offset] = value; } catch(ArrayIndexOutOfBoundsException aioobe) */ { if (offset >= slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); chunk[slotpos + offset] = value; // ATOMIC! } }
Overwrite the integer found at a specific record and column. Used to back-patch existing records, most often changing their "next sibling" reference from 0 (unknown) to something meaningful @param position int Record number @param offset int Column number @param value int New contents
ChunkedIntArray::writeEntry
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
Apache-2.0
void writeSlot(int position, int w0, int w1, int w2, int w3) { position *= slotsize; int chunkpos = position >> lowbits; int slotpos = (position & lowmask); // Grow if needed if (chunkpos > chunks.size() - 1) chunks.addElement(new int[chunkalloc]); int[] chunk = chunks.elementAt(chunkpos); chunk[slotpos] = w0; chunk[slotpos + 1] = w1; chunk[slotpos + 2] = w2; chunk[slotpos + 3] = w3; }
Overwrite an entire (4-integer) record at the specified index. Mostly used to create record 0, the Document node. @param position integer Record number @param w0 int @param w1 int @param w2 int @param w3 int
ChunkedIntArray::writeSlot
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
Apache-2.0
void readSlot(int position, int[] buffer) { /* try { System.arraycopy(fastArray, position*slotsize, buffer, 0, slotsize); } catch(ArrayIndexOutOfBoundsException aioobe) */ { // System.out.println("Using slow read (2): "+position); position *= slotsize; int chunkpos = position >> lowbits; int slotpos = (position & lowmask); // Grow if needed if (chunkpos > chunks.size() - 1) chunks.addElement(new int[chunkalloc]); int[] chunk = chunks.elementAt(chunkpos); System.arraycopy(chunk,slotpos,buffer,0,slotsize); } }
Retrieve the contents of a record into a user-supplied buffer array. Used to reduce addressing overhead when code will access several columns of the record. @param position int Record number @param buffer int[] Integer array provided by user, must be large enough to hold a complete record.
ChunkedIntArray::readSlot
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
Apache-2.0
public DTMNamedNodeMap(DTM dtm, int element) { this.dtm = dtm; this.element = element; }
Create a getAttributes NamedNodeMap for a given DTM element node @param dtm The DTM Reference, must be non-null. @param element The DTM element handle.
DTMNamedNodeMap::DTMNamedNodeMap
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public int getLength() { if (m_count == -1) { short count = 0; for (int n = dtm.getFirstAttribute(element); n != -1; n = dtm.getNextAttribute(n)) { ++count; } m_count = count; } return (int) m_count; }
Return the number of Attributes on this Element @return The number of nodes in this map.
DTMNamedNodeMap::getLength
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public Node getNamedItem(String name) { for (int n = dtm.getFirstAttribute(element); n != DTM.NULL; n = dtm.getNextAttribute(n)) { if (dtm.getNodeName(n).equals(name)) return dtm.getNode(n); } return null; }
Retrieves a node specified by name. @param name The <code>nodeName</code> of a node to retrieve. @return A <code>Node</code> (of any type) with the specified <code>nodeName</code>, or <code>null</code> if it does not identify any node in this map.
DTMNamedNodeMap::getNamedItem
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public Node item(int i) { int count = 0; for (int n = dtm.getFirstAttribute(element); n != -1; n = dtm.getNextAttribute(n)) { if (count == i) return dtm.getNode(n); else ++count; } return null; }
Returns the <code>index</code>th item in the map. If <code>index</code> is greater than or equal to the number of nodes in this map, this returns <code>null</code>. @param i The index of the requested item. @return The node at the <code>index</code>th position in the map, or <code>null</code> if that is not a valid index.
DTMNamedNodeMap::item
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public Node setNamedItem(Node newNode) { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
Adds a node using its <code>nodeName</code> attribute. If a node with that name is already present in this map, it is replaced by the new one. <br>As the <code>nodeName</code> attribute is used to derive the name which the node must be stored under, multiple nodes of certain types (those that have a "special" string value) cannot be stored as the names would clash. This is seen as preferable to allowing nodes to be aliased. @param newNode node to store in this map. The node will later be accessible using the value of its <code>nodeName</code> attribute. @return If the new <code>Node</code> replaces an existing node the replaced <code>Node</code> is returned, otherwise <code>null</code> is returned. @exception DOMException WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a different document than the one that created this map. <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an <code>Attr</code> that is already an attribute of another <code>Element</code> object. The DOM user must explicitly clone <code>Attr</code> nodes to re-use them in other elements.
DTMNamedNodeMap::setNamedItem
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public Node removeNamedItem(String name) { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
Removes a node specified by name. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable. @param name The <code>nodeName</code> of the node to remove. @return The node removed from this map if a node with such a name exists. @exception DOMException NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in this map. <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
DTMNamedNodeMap::removeNamedItem
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public Node getNamedItemNS(String namespaceURI, String localName) { Node retNode = null; for (int n = dtm.getFirstAttribute(element); n != DTM.NULL; n = dtm.getNextAttribute(n)) { if (localName.equals(dtm.getLocalName(n))) { String nsURI = dtm.getNamespaceURI(n); if ((namespaceURI == null && nsURI == null) || (namespaceURI != null && namespaceURI.equals(nsURI))) { retNode = dtm.getNode(n); break; } } } return retNode; }
Retrieves a node specified by local name and namespace URI. HTML-only DOM implementations do not need to implement this method. @param namespaceURI The namespace URI of the node to retrieve. @param localName The local name of the node to retrieve. @return A <code>Node</code> (of any type) with the specified local name and namespace URI, or <code>null</code> if they do not identify any node in this map. @since DOM Level 2
DTMNamedNodeMap::getNamedItemNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public Node setNamedItemNS(Node arg) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
Adds a node using its <code>namespaceURI</code> and <code>localName</code>. If a node with that namespace URI and that local name is already present in this map, it is replaced by the new one. <br>HTML-only DOM implementations do not need to implement this method. @param arg A node to store in this map. The node will later be accessible using the value of its <code>namespaceURI</code> and <code>localName</code> attributes. @return If the new <code>Node</code> replaces an existing node the replaced <code>Node</code> is returned, otherwise <code>null</code> is returned. @exception DOMException WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a different document than the one that created this map. <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an <code>Attr</code> that is already an attribute of another <code>Element</code> object. The DOM user must explicitly clone <code>Attr</code> nodes to re-use them in other elements. @since DOM Level 2
DTMNamedNodeMap::setNamedItemNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
Removes a node specified by local name and namespace URI. A removed attribute may be known to have a default value when this map contains the attributes attached to an element, as returned by the attributes attribute of the <code>Node</code> interface. If so, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable. <br>HTML-only DOM implementations do not need to implement this method. @param namespaceURI The namespace URI of the node to remove. @param localName The local name of the node to remove. @return The node removed from this map if a node with such a local name and namespace URI exists. @exception DOMException NOT_FOUND_ERR: Raised if there is no node with the specified <code>namespaceURI</code> and <code>localName</code> in this map. <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. @since DOM Level 2
DTMNamedNodeMap::removeNamedItemNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public DTMException(short code) { super(code, ""); }
Constructor DTMException @param code
DTMException::DTMException
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Apache-2.0
public synchronized int co_joinCoroutineSet(int coroutineID) { if(coroutineID>=0) { if(coroutineID>=m_unreasonableId || m_activeIDs.get(coroutineID)) return -1; } else { // What I want is "Find first clear bit". That doesn't exist. // JDK1.2 added "find last set bit", but that doesn't help now. coroutineID=0; while(coroutineID<m_unreasonableId) { if(m_activeIDs.get(coroutineID)) ++coroutineID; else break; } if(coroutineID>=m_unreasonableId) return -1; } m_activeIDs.set(coroutineID); return coroutineID; }
<p>Each coroutine in the set managed by a single CoroutineManager is identified by a small positive integer. This brings up the question of how to manage those integers to avoid reuse... since if two coroutines use the same ID number, resuming that ID could resume either. I can see arguments for either allowing applications to select their own numbers (they may want to declare mnemonics via manefest constants) or generating numbers on demand. This routine's intended to support both approaches.</p> <p>%REVIEW% We could use an object as the identifier. Not sure it's a net gain, though it would allow the thread to be its own ID. Ponder.</p> @param coroutineID If >=0, requests that we reserve this number. If <0, requests that we find, reserve, and return an available ID number. @return If >=0, the ID number to be used by this coroutine. If <0, an error occurred -- the ID requested was already in use, or we couldn't assign one without going over the "unreasonable value" mark *
CoroutineManager::co_joinCoroutineSet
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
Apache-2.0
public synchronized Object co_entry_pause(int thisCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(thisCoroutine)) throw new java.lang.NoSuchMethodException(); while(m_nextCoroutine != thisCoroutine) { try { wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance widdershins about the instruction cache? } } return m_yield; }
In the standard coroutine architecture, coroutines are identified by their method names and are launched and run up to their first yield by simply resuming them; its's presumed that this recognizes the not-already-running case and does the right thing. We seem to need a way to achieve that same threadsafe run-up... eg, start the coroutine with a wait. %TBD% whether this makes any sense... @param thisCoroutine the identifier of this coroutine, so we can recognize when we are being resumed. @exception java.lang.NoSuchMethodException if thisCoroutine isn't a registered member of this group. %REVIEW% whether this is the best choice. *
CoroutineManager::co_entry_pause
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
Apache-2.0
public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; notify(); while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY) { try { // System.out.println("waiting..."); wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance deasil about the program counter? } } if(m_nextCoroutine==NOBODY) { // Pass it along co_exit(thisCoroutine); // And inform this coroutine that its partners are Going Away // %REVIEW% Should this throw/return something more useful? throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request"); } return m_yield; }
Transfer control to another coroutine which has already been started and is waiting on this CoroutineManager. We won't return from this call until that routine has relinquished control. %TBD% What should we do if toCoroutine isn't registered? Exception? @param arg_object A value to be passed to the other coroutine. @param thisCoroutine Integer identifier for this coroutine. This is the ID we watch for to see if we're the ones being resumed. @param toCoroutine Integer identifier for the coroutine we wish to invoke. @exception java.lang.NoSuchMethodException if toCoroutine isn't a registered member of this group. %REVIEW% whether this is the best choice. *
CoroutineManager::co_resume
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
Apache-2.0
public synchronized void co_exit(int thisCoroutine) { m_activeIDs.clear(thisCoroutine); m_nextCoroutine=NOBODY; // %REVIEW% notify(); }
Terminate this entire set of coroutines. The others will be deregistered and have exceptions thrown at them. Note that this is intended as a panic-shutdown operation; under normal circumstances a coroutine should always end with co_exit_to() in order to politely inform at least one of its partners that it is going away. %TBD% This may need significantly more work. %TBD% Should this just be co_exit_to(,,CoroutineManager.PANIC)? @param thisCoroutine Integer identifier for the coroutine requesting exit. *
CoroutineManager::co_exit
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
Apache-2.0
public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; m_activeIDs.clear(thisCoroutine); notify(); }
Make the ID available for reuse and terminate this coroutine, transferring control to the specified coroutine. Note that this returns immediately rather than waiting for any further coroutine traffic, so the thread can proceed with other shutdown activities. @param arg_object A value to be passed to the other coroutine. @param thisCoroutine Integer identifier for the coroutine leaving the set. @param toCoroutine Integer identifier for the coroutine we wish to invoke. @exception java.lang.NoSuchMethodException if toCoroutine isn't a registered member of this group. %REVIEW% whether this is the best choice. *
CoroutineManager::co_exit_to
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java
Apache-2.0
public DTMStringPool(int chainSize) { m_intToString=new Vector(); m_hashChain=new IntVector(chainSize); removeAllElements(); // -sb Add this to force empty strings to be index 0. stringToIndex(""); }
Create a DTMStringPool using the given chain size @param chainSize The size of the hash chain vector
DTMStringPool::DTMStringPool
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java
Apache-2.0
public String indexToString(int i) throws java.lang.ArrayIndexOutOfBoundsException { if(i==NULL) return null; return (String) m_intToString.elementAt(i); }
@return string whose value is uniquely identified by this integer index. @throws java.lang.ArrayIndexOutOfBoundsException if index doesn't map to a string. *
DTMStringPool::indexToString
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java
Apache-2.0
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 string whose value is uniquely identified by this integer index. @throws java.lang.ArrayIndexOutOfBoundsException if index doesn't map to a string. * public String indexToString(int i) throws java.lang.ArrayIndexOutOfBoundsException { if(i==NULL) return null; return (String) m_intToString.elementAt(i); } /** @return integer index uniquely identifying the value of this string.
DTMStringPool::stringToIndex
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java
Apache-2.0
public static void main(String[] args) { String[] word={ "Zero","One","Two","Three","Four","Five", "Six","Seven","Eight","Nine","Ten", "Eleven","Twelve","Thirteen","Fourteen","Fifteen", "Sixteen","Seventeen","Eighteen","Nineteen","Twenty", "Twenty-One","Twenty-Two","Twenty-Three","Twenty-Four", "Twenty-Five","Twenty-Six","Twenty-Seven","Twenty-Eight", "Twenty-Nine","Thirty","Thirty-One","Thirty-Two", "Thirty-Three","Thirty-Four","Thirty-Five","Thirty-Six", "Thirty-Seven","Thirty-Eight","Thirty-Nine"}; DTMStringPool pool=new DTMStringPool(); System.out.println("If no complaints are printed below, we passed initial test."); for(int pass=0;pass<=1;++pass) { int i; for(i=0;i<word.length;++i) { int j=pool.stringToIndex(word[i]); if(j!=i) System.out.println("\tMismatch populating pool: assigned "+ j+" for create "+i); } for(i=0;i<word.length;++i) { int j=pool.stringToIndex(word[i]); if(j!=i) System.out.println("\tMismatch in stringToIndex: returned "+ j+" for lookup "+i); } for(i=0;i<word.length;++i) { String w=pool.indexToString(i); if(!word[i].equals(w)) System.out.println("\tMismatch in indexToString: returned"+ w+" for lookup "+i); } pool.removeAllElements(); System.out.println("\nPass "+pass+" complete\n"); } // end pass loop }
Command-line unit test driver. This test relies on the fact that this version of the pool assigns indices consecutively, starting from zero, as new unique strings are encountered.
DTMStringPool::main
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java
Apache-2.0
public DTMNodeProxy(DTM dtm, int node) { this.dtm = dtm; this.node = node; }
Create a DTMNodeProxy Node representing a specific Node in a DTM @param dtm The DTM Reference, must be non-null. @param node The DTM node handle.
DTMNodeProxy::DTMNodeProxy
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final DTM getDTM() { return dtm; }
NON-DOM: Return the DTM model @return The DTM that this proxy is a representative for.
DTMNodeProxy::getDTM
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final int getDTMNodeNumber() { return node; }
NON-DOM: Return the DTM node number @return The DTM node handle.
DTMNodeProxy::getDTMNodeNumber
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final boolean equals(Node node) { try { DTMNodeProxy dtmp = (DTMNodeProxy) node; // return (dtmp.node == this.node); // Patch attributed to Gary L Peskin <[email protected]> return (dtmp.node == this.node) && (dtmp.dtm == this.dtm); } catch (ClassCastException cce) { return false; } }
Test for equality based on node number. @param node A DTM node proxy reference. @return true if the given node has the same handle as this node.
DTMNodeProxy::equals
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final boolean sameNodeAs(Node other) { if (!(other instanceof DTMNodeProxy)) return false; DTMNodeProxy that = (DTMNodeProxy) other; return this.dtm == that.dtm && this.node == that.node; }
FUTURE DOM: Test node identity, in lieu of Node==Node @param other @return true if the given node has the same handle as this node.
DTMNodeProxy::sameNodeAs
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getNodeName() { return dtm.getNodeName(node); }
@see org.w3c.dom.Node
DTMNodeProxy::getNodeName
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getTarget() { return dtm.getNodeName(node); } // getTarget():String
A PI's "target" states what processor channel the PI's data should be directed to. It is defined differently in HTML and XML. <p> In XML, a PI's "target" is the first (whitespace-delimited) token following the "<?" token that begins the PI. <p> In HTML, target is always null. <p> Note that getNodeName is aliased to getTarget.
DTMNodeProxy::getTarget
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getLocalName() { return dtm.getLocalName(node); }
@see org.w3c.dom.Node as of DOM Level 2
DTMNodeProxy::getLocalName
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getPrefix() { return dtm.getPrefix(node); }
@return The prefix for this node. @see org.w3c.dom.Node as of DOM Level 2
DTMNodeProxy::getPrefix
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void setPrefix(String prefix) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
@param prefix @throws DOMException @see org.w3c.dom.Node as of DOM Level 2 -- DTMNodeProxy is read-only
DTMNodeProxy::setPrefix
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final boolean supports(String feature, String version) { return implementation.hasFeature(feature,version); //throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
Ask whether we support a given DOM feature. In fact, we do not _fully_ support any DOM feature -- we're a read-only subset -- so arguably we should always return false. Or we could say that we support DOM Core Level 2 but all nodes are read-only. Unclear which answer is least misleading. NON-DOM method. This was present in early drafts of DOM Level 2, but was renamed isSupported. It's present here only because it's cheap, harmless, and might help some poor fool who is still trying to use an early Working Draft of the DOM. @param feature @param version @return false
DTMNodeProxy::supports
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final boolean isSupported(String feature, String version) { return implementation.hasFeature(feature,version); // throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
Ask whether we support a given DOM feature. In fact, we do not _fully_ support any DOM feature -- we're a read-only subset -- so arguably we should always return false. @param feature @param version @return false @see org.w3c.dom.Node as of DOM Level 2
DTMNodeProxy::isSupported
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getNodeValue() throws DOMException { return dtm.getNodeValue(node); }
@throws DOMException @see org.w3c.dom.Node
DTMNodeProxy::getNodeValue
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getStringValue() throws DOMException { return dtm.getStringValue(node).toString(); }
@return The string value of the node @throws DOMException
DTMNodeProxy::getStringValue
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void setNodeValue(String nodeValue) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
@param nodeValue @throws DOMException @see org.w3c.dom.Node -- DTMNodeProxy is read-only
DTMNodeProxy::setNodeValue
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public boolean hasAttribute(String name) { return DTM.NULL != dtm.getAttributeNode(node,null,name); }
Method hasAttribute @param name
DTMNodeProxy::hasAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public boolean hasAttributeNS(String namespaceURI, String localName) { return DTM.NULL != dtm.getAttributeNode(node,namespaceURI,localName); }
Method hasAttributeNS @param namespaceURI @param localName
DTMNodeProxy::hasAttributeNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Node insertBefore(Node newChild, Node refChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
@param newChild @param refChild @throws DOMException @see org.w3c.dom.Node -- DTMNodeProxy is read-only
DTMNodeProxy::insertBefore
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0