code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
844 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public final int getFirstAttribute(int nodeHandle) { int nodeID = makeNodeIdentity(nodeHandle); if (nodeID == DTM.NULL) return DTM.NULL; int type = _type2(nodeID); if (DTM.ELEMENT_NODE == type) { // Assume that attributes and namespaces immediately follow the element. while (true) { nodeID++; // Assume this can not be null. type = _type2(nodeID); if (type == DTM.ATTRIBUTE_NODE) { return makeNodeHandle(nodeID); } else if (DTM.NAMESPACE_NODE != type) { break; } } } return DTM.NULL; }
The optimized version of DTMDefaultBase.getFirstAttribute(). <p> Given a node handle, get the index of the node's first attribute. @param nodeHandle int Handle of the node. @return Handle of first attribute, or DTM.NULL to indicate none exists.
TypedSingletonIterator::getFirstAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected int getFirstAttributeIdentity(int identity) { if (identity == NULL) { return NULL; } int type = _type2(identity); if (DTM.ELEMENT_NODE == type) { // Assume that attributes and namespaces immediately follow the element. while (true) { identity++; // Assume this can not be null. type = _type2(identity); if (type == DTM.ATTRIBUTE_NODE) { return identity; } else if (DTM.NAMESPACE_NODE != type) { break; } } } return DTM.NULL; }
The optimized version of DTMDefaultBase.getFirstAttributeIdentity(int). <p> Given a node identity, get the index of the node's first attribute. @param identity int identity of the node. @return Identity of first attribute, or DTM.NULL to indicate none exists.
TypedSingletonIterator::getFirstAttributeIdentity
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected int getNextAttributeIdentity(int identity) { // Assume that attributes and namespace nodes immediately follow the element while (true) { identity++; int type = _type2(identity); if (type == DTM.ATTRIBUTE_NODE) { return identity; } else if (type != DTM.NAMESPACE_NODE) { break; } } return DTM.NULL; }
The optimized version of DTMDefaultBase.getNextAttributeIdentity(int). <p> Given a node identity for an attribute, advance to the next attribute. @param identity int identity of the attribute node. This <strong>must</strong> be an attribute node. @return int DTM node-identity of the resolved attr, or DTM.NULL to indicate none exists.
TypedSingletonIterator::getNextAttributeIdentity
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final int getTypedAttribute(int nodeHandle, int attType) { int nodeID = makeNodeIdentity(nodeHandle); if (nodeID == DTM.NULL) return DTM.NULL; int type = _type2(nodeID); if (DTM.ELEMENT_NODE == type) { int expType; while (true) { nodeID++; expType = _exptype2(nodeID); if (expType != DTM.NULL) type = m_extendedTypes[expType].getNodeType(); else return DTM.NULL; if (type == DTM.ATTRIBUTE_NODE) { if (expType == attType) return makeNodeHandle(nodeID); } else if (DTM.NAMESPACE_NODE != type) { break; } } } return DTM.NULL; }
The optimized version of DTMDefaultBase.getTypedAttribute(int, int). <p> Given a node handle and an expanded type ID, get the index of the node's attribute of that type, if any. @param nodeHandle int Handle of the node. @param attType int expanded type ID of the required attribute. @return Handle of attribute of the required type, or DTM.NULL to indicate none exists.
TypedSingletonIterator::getTypedAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public String getLocalName(int nodeHandle) { int expType = _exptype(makeNodeIdentity(nodeHandle)); if (expType == DTM.PROCESSING_INSTRUCTION_NODE) { int dataIndex = _dataOrQName(makeNodeIdentity(nodeHandle)); dataIndex = m_data.elementAt(-dataIndex); return m_valuesOrPrefixes.indexToString(dataIndex); } else return m_expandedNameTable.getLocalName(expType); }
Override SAX2DTM.getLocalName() in SAX2DTM2. <p>Processing for PIs is different. Given a node handle, return its XPath- style localname. (As defined in Namespaces, this is the portion of the name after any colon character). @param nodeHandle the id of the node. @return String Local name of this node.
TypedSingletonIterator::getLocalName
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final String getNodeNameX(int nodeHandle) { int nodeID = makeNodeIdentity(nodeHandle); int eType = _exptype2(nodeID); if (eType == DTM.PROCESSING_INSTRUCTION_NODE) { int dataIndex = _dataOrQName(nodeID); dataIndex = m_data.elementAt(-dataIndex); return m_valuesOrPrefixes.indexToString(dataIndex); } final ExtendedType extType = m_extendedTypes[eType]; if (extType.getNamespace().length() == 0) { return extType.getLocalName(); } else { int qnameIndex = m_dataOrQName.elementAt(nodeID); if (qnameIndex == 0) return extType.getLocalName(); if (qnameIndex < 0) { qnameIndex = -qnameIndex; qnameIndex = m_data.elementAt(qnameIndex); } return m_valuesOrPrefixes.indexToString(qnameIndex); } }
The optimized version of SAX2DTM.getNodeNameX(). <p> 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, which may be an empty string.
TypedSingletonIterator::getNodeNameX
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public String getNodeName(int nodeHandle) { int nodeID = makeNodeIdentity(nodeHandle); int eType = _exptype2(nodeID); final ExtendedType extType = m_extendedTypes[eType]; if (extType.getNamespace().length() == 0) { int type = extType.getNodeType(); String localName = extType.getLocalName(); if (type == DTM.NAMESPACE_NODE) { if (localName.length() == 0) return "xmlns"; else return "xmlns:" + localName; } else if (type == DTM.PROCESSING_INSTRUCTION_NODE) { int dataIndex = _dataOrQName(nodeID); dataIndex = m_data.elementAt(-dataIndex); return m_valuesOrPrefixes.indexToString(dataIndex); } else if (localName.length() == 0) { return getFixedNames(type); } else return localName; } else { int qnameIndex = m_dataOrQName.elementAt(nodeID); if (qnameIndex == 0) return extType.getLocalName(); if (qnameIndex < 0) { qnameIndex = -qnameIndex; qnameIndex = m_data.elementAt(qnameIndex); } return m_valuesOrPrefixes.indexToString(qnameIndex); } }
The optimized version of SAX2DTM.getNodeName(). <p> 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... %REVIEW-COMMENT% It should never be empty, should it?
TypedSingletonIterator::getNodeName
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public XMLString getStringValue(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); if (identity == DTM.NULL) return EMPTY_XML_STR; int type= _type2(identity); if (type == DTM.ELEMENT_NODE || type == DTM.DOCUMENT_NODE) { int startNode = identity; identity = _firstch2(identity); if (DTM.NULL != identity) { int offset = -1; int length = 0; do { type = _exptype2(identity); if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { if (-1 == offset) { offset = dataIndex >>> TEXT_LENGTH_BITS; } length += dataIndex & TEXT_LENGTH_MAX; } else { if (-1 == offset) { offset = m_data.elementAt(-dataIndex); } length += m_data.elementAt(-dataIndex + 1); } } identity++; } while (_parent2(identity) >= startNode); if (length > 0) { if (m_xstrf != null) return m_xstrf.newstr(m_chars, offset, length); else return new XMLStringDefault(m_chars.getString(offset, length)); } else return EMPTY_XML_STR; } else return EMPTY_XML_STR; } else if (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { if (m_xstrf != null) return m_xstrf.newstr(m_chars, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); else return new XMLStringDefault(m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX)); } else { if (m_xstrf != null) return m_xstrf.newstr(m_chars, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); else return new XMLStringDefault(m_chars.getString(m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1))); } } else { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } if (m_xstrf != null) return m_xstrf.newstr((String)m_values.elementAt(dataIndex)); else return new XMLStringDefault((String)m_values.elementAt(dataIndex)); } }
Override SAX2DTM.getStringValue(int) <p> This method is only used by Xalan-J Interpretive. It is not used by XSLTC. <p> If the caller supplies an XMLStringFactory, the getStringValue() interface in SAX2DTM will be called. Otherwise just calls getStringValueX() and wraps the returned String in an XMLString. Get the string-value of a node as a String object (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value). @param nodeHandle The node ID. @return A string object that represents the string-value of the given node.
TypedSingletonIterator::getStringValue
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final String getStringValueX(final int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); if (identity == DTM.NULL) return EMPTY_STR; int type= _type2(identity); if (type == DTM.ELEMENT_NODE || type == DTM.DOCUMENT_NODE) { int startNode = identity; identity = _firstch2(identity); if (DTM.NULL != identity) { int offset = -1; int length = 0; do { type = _exptype2(identity); if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { if (-1 == offset) { offset = dataIndex >>> TEXT_LENGTH_BITS; } length += dataIndex & TEXT_LENGTH_MAX; } else { if (-1 == offset) { offset = m_data.elementAt(-dataIndex); } length += m_data.elementAt(-dataIndex + 1); } } identity++; } while (_parent2(identity) >= startNode); if (length > 0) { return m_chars.getString(offset, length); } else return EMPTY_STR; } else return EMPTY_STR; } else if (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { return m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); } else { return m_chars.getString(m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); } } else { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } return (String)m_values.elementAt(dataIndex); } }
The optimized version of SAX2DTM.getStringValue(int). <p> %OPT% This is one of the most often used interfaces. Performance is critical here. This one is different from SAX2DTM.getStringValue(int) in that it returns a String instead of a XMLString. Get the string- value of a node as a String object (see http: //www. w3. org/TR/xpath#data- model for the definition of a node's string- value). @param nodeHandle The node ID. @return A string object that represents the string-value of the given node.
TypedSingletonIterator::getStringValueX
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public String getStringValue() { int child = _firstch2(ROOTNODE); if (child == DTM.NULL) return EMPTY_STR; // optimization: only create StringBuffer if > 1 child if ((_exptype2(child) == DTM.TEXT_NODE) && (_nextsib2(child) == DTM.NULL)) { int dataIndex = m_dataOrQName.elementAt(child); if (dataIndex >= 0) return m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); else return m_chars.getString(m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex + 1)); } else return getStringValueX(getDocument()); }
Returns the string value of the entire tree
TypedSingletonIterator::getStringValue
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final void dispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize) throws SAXException { int identity = makeNodeIdentity(nodeHandle); if (identity == DTM.NULL) return; int type = _type2(identity); if (type == DTM.ELEMENT_NODE || type == DTM.DOCUMENT_NODE) { int startNode = identity; identity = _firstch2(identity); if (DTM.NULL != identity) { int offset = -1; int length = 0; do { type = _exptype2(identity); if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { if (-1 == offset) { offset = dataIndex >>> TEXT_LENGTH_BITS; } length += dataIndex & TEXT_LENGTH_MAX; } else { if (-1 == offset) { offset = m_data.elementAt(-dataIndex); } length += m_data.elementAt(-dataIndex + 1); } } identity++; } while (_parent2(identity) >= startNode); if (length > 0) { if(normalize) m_chars.sendNormalizedSAXcharacters(ch, offset, length); else m_chars.sendSAXcharacters(ch, offset, length); } } } else if (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { if (normalize) m_chars.sendNormalizedSAXcharacters(ch, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); else m_chars.sendSAXcharacters(ch, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); } else { if (normalize) m_chars.sendNormalizedSAXcharacters(ch, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); else m_chars.sendSAXcharacters(ch, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); } } else { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } String str = (String)m_values.elementAt(dataIndex); if(normalize) FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(), 0, str.length(), ch); else ch.characters(str.toCharArray(), 0, str.length()); } }
The optimized version of SAX2DTM.dispatchCharactersEvents(int, ContentHandler, boolean). <p> Directly call the characters method on the passed ContentHandler for the string-value of the given node (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value). Multiple calls to the ContentHandler's characters methods may well occur for a single call to this method. @param nodeHandle The node ID. @param ch A non-null reference to a ContentHandler. @param normalize true if the content should be normalized according to the rules for the XPath <a href="http://www.w3.org/TR/xpath#function-normalize-space">normalize-space</a> function. @throws SAXException
TypedSingletonIterator::dispatchCharactersEvents
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public String getNodeValue(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int type = _type2(identity); if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE) { int dataIndex = _dataOrQName(identity); if (dataIndex > 0) { return m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); } else { return m_chars.getString(m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); } } else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type || DTM.DOCUMENT_NODE == type) { return null; } else { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } return (String)m_values.elementAt(dataIndex); } }
Given a node handle, return its node value. This is mostly as defined by the DOM, but may ignore some conveniences. <p> @param nodeHandle The node id. @return String Value of this node, or null if not meaningful for this node type.
TypedSingletonIterator::getNodeValue
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final void copyTextNode(final int nodeID, SerializationHandler handler) throws SAXException { if (nodeID != DTM.NULL) { int dataIndex = m_dataOrQName.elementAt(nodeID); if (dataIndex >= 0) { m_chars.sendSAXcharacters(handler, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); } else { m_chars.sendSAXcharacters(handler, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); } } }
Copy the String value of a Text node to a SerializationHandler
TypedSingletonIterator::copyTextNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final String copyElement(int nodeID, int exptype, SerializationHandler handler) throws SAXException { final ExtendedType extType = m_extendedTypes[exptype]; String uri = extType.getNamespace(); String name = extType.getLocalName(); if (uri.length() == 0) { handler.startElement(name); return name; } else { int qnameIndex = m_dataOrQName.elementAt(nodeID); if (qnameIndex == 0) { handler.startElement(name); handler.namespaceAfterStartElement(EMPTY_STR, uri); return name; } if (qnameIndex < 0) { qnameIndex = -qnameIndex; qnameIndex = m_data.elementAt(qnameIndex); } String qName = m_valuesOrPrefixes.indexToString(qnameIndex); handler.startElement(qName); int prefixIndex = qName.indexOf(':'); String prefix; if (prefixIndex > 0) { prefix = qName.substring(0, prefixIndex); } else { prefix = null; } handler.namespaceAfterStartElement(prefix, uri); return qName; } }
Copy an Element node to a SerializationHandler. @param nodeID The node identity @param exptype The expanded type of the Element node @param handler The SerializationHandler @return The qualified name of the Element node.
TypedSingletonIterator::copyElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final void copyNS(final int nodeID, SerializationHandler handler, boolean inScope) throws SAXException { // %OPT% Optimization for documents which does not have any explicit // namespace nodes. For these documents, there is an implicit // namespace node (xmlns:xml="http://www.w3.org/XML/1998/namespace") // declared on the root element node. In this case, there is no // need to do namespace copying. We can safely return without // doing anything. if (m_namespaceDeclSetElements != null && m_namespaceDeclSetElements.size() == 1 && m_namespaceDeclSets != null && ((SuballocatedIntVector)m_namespaceDeclSets.elementAt(0)) .size() == 1) return; SuballocatedIntVector nsContext = null; int nextNSNode; // Find the first namespace node if (inScope) { nsContext = findNamespaceContext(nodeID); if (nsContext == null || nsContext.size() < 1) return; else nextNSNode = makeNodeIdentity(nsContext.elementAt(0)); } else nextNSNode = getNextNamespaceNode2(nodeID); int nsIndex = 1; while (nextNSNode != DTM.NULL) { // Retrieve the name of the namespace node int eType = _exptype2(nextNSNode); String nodeName = m_extendedTypes[eType].getLocalName(); // Retrieve the node value of the namespace node int dataIndex = m_dataOrQName.elementAt(nextNSNode); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } String nodeValue = (String)m_values.elementAt(dataIndex); handler.namespaceAfterStartElement(nodeName, nodeValue); if (inScope) { if (nsIndex < nsContext.size()) { nextNSNode = makeNodeIdentity(nsContext.elementAt(nsIndex)); nsIndex++; } else return; } else nextNSNode = getNextNamespaceNode2(nextNSNode); } }
Copy namespace nodes. @param nodeID The Element node identity @param handler The SerializationHandler @param inScope true if all namespaces in scope should be copied, false if only the namespace declarations should be copied.
TypedSingletonIterator::copyNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final int getNextNamespaceNode2(int baseID) { int type; while ((type = _type2(++baseID)) == DTM.ATTRIBUTE_NODE); if (type == DTM.NAMESPACE_NODE) return baseID; else return NULL; }
Return the next namespace node following the given base node. @baseID The node identity of the base node, which can be an element, attribute or namespace node. @return The namespace node immediately following the base node.
TypedSingletonIterator::getNextNamespaceNode2
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final void copyAttributes(final int nodeID, SerializationHandler handler) throws SAXException{ for(int current = getFirstAttributeIdentity(nodeID); current != DTM.NULL; current = getNextAttributeIdentity(current)){ int eType = _exptype2(current); copyAttribute(current, eType, handler); } }
Copy attribute nodes from an element . @param nodeID The Element node identity @param handler The SerializationHandler
TypedSingletonIterator::copyAttributes
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final void copyAttribute(int nodeID, int exptype, SerializationHandler handler) throws SAXException { /* final String uri = getNamespaceName(node); if (uri.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri); } handler.addAttribute(getNodeName(node), getNodeValue(node)); */ final ExtendedType extType = m_extendedTypes[exptype]; final String uri = extType.getNamespace(); final String localName = extType.getLocalName(); String prefix = null; String qname = null; int dataIndex = _dataOrQName(nodeID); int valueIndex = dataIndex; if (dataIndex <= 0) { int prefixIndex = m_data.elementAt(-dataIndex); valueIndex = m_data.elementAt(-dataIndex+1); qname = m_valuesOrPrefixes.indexToString(prefixIndex); int colonIndex = qname.indexOf(':'); if (colonIndex > 0) { prefix = qname.substring(0, colonIndex); } } if (uri.length() != 0) { handler.namespaceAfterStartElement(prefix, uri); } String nodeName = (prefix != null) ? qname : localName; String nodeValue = (String)m_values.elementAt(valueIndex); handler.addAttribute(nodeName, nodeValue); }
Copy an Attribute node to a SerializationHandler @param nodeID The node identity @param exptype The expanded type of the Element node @param handler The SerializationHandler
TypedSingletonIterator::copyAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public ObjectVector() { m_blocksize = 32; m_mapSize = m_blocksize; m_map = new Object[m_blocksize]; }
Default constructor. Note that the default block size is very small, for small lists.
ObjectVector::ObjectVector
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public ObjectVector(int blocksize) { m_blocksize = blocksize; m_mapSize = blocksize; m_map = new Object[blocksize]; }
Construct a IntVector, using the given block size. @param blocksize Size of block to allocate
ObjectVector::ObjectVector
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public ObjectVector(int blocksize, int increaseSize) { m_blocksize = increaseSize; m_mapSize = blocksize; m_map = new Object[blocksize]; }
Construct a IntVector, using the given block size. @param blocksize Size of block to allocate
ObjectVector::ObjectVector
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public ObjectVector(ObjectVector v) { m_map = new Object[v.m_mapSize]; m_mapSize = v.m_mapSize; m_firstFree = v.m_firstFree; m_blocksize = v.m_blocksize; System.arraycopy(v.m_map, 0, m_map, 0, m_firstFree); }
Copy constructor for ObjectVector @param v Existing ObjectVector to copy
ObjectVector::ObjectVector
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final int size() { return m_firstFree; }
Get the length of the list. @return length of the list
ObjectVector::size
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final void setSize(int sz) { m_firstFree = sz; }
Get the length of the list. @return length of the list
ObjectVector::setSize
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final void addElement(Object value) { if ((m_firstFree + 1) >= m_mapSize) { m_mapSize += m_blocksize; Object newMap[] = new Object[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } m_map[m_firstFree] = value; m_firstFree++; }
Append an object onto the vector. @param value Object to add to the list
ObjectVector::addElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final void addElements(Object value, int numberOfElements) { if ((m_firstFree + numberOfElements) >= m_mapSize) { m_mapSize += (m_blocksize+numberOfElements); Object newMap[] = new Object[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } for (int i = 0; i < numberOfElements; i++) { m_map[m_firstFree] = value; m_firstFree++; } }
Append several Object values onto the vector. @param value Object to add to the list
ObjectVector::addElements
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final void addElements(int numberOfElements) { if ((m_firstFree + numberOfElements) >= m_mapSize) { m_mapSize += (m_blocksize+numberOfElements); Object newMap[] = new Object[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } m_firstFree += numberOfElements; }
Append several slots onto the vector, but do not set the values. @param numberOfElements number of slots to append
ObjectVector::addElements
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final void insertElementAt(Object value, int at) { if ((m_firstFree + 1) >= m_mapSize) { m_mapSize += m_blocksize; Object newMap[] = new Object[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } if (at <= (m_firstFree - 1)) { System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at); } m_map[at] = value; m_firstFree++; }
Inserts the specified object in this vector at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously. @param value Object to insert @param at Index of where to insert
ObjectVector::insertElementAt
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final void removeAllElements() { for (int i = 0; i < m_firstFree; i++) { m_map[i] = null; } m_firstFree = 0; }
Remove all elements objects from the list.
ObjectVector::removeAllElements
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final boolean removeElement(Object s) { for (int i = 0; i < m_firstFree; i++) { if (m_map[i] == s) { if ((i + 1) < m_firstFree) System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i); else m_map[i] = null; m_firstFree--; return true; } } return false; }
Removes the first occurrence of the argument from this vector. If the object is found in this vector, each component in the vector with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously. @param s Object to remove from array @return True if the object was removed, false if it was not found
ObjectVector::removeElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final void removeElementAt(int i) { if (i > m_firstFree) System.arraycopy(m_map, i + 1, m_map, i, m_firstFree); else m_map[i] = null; m_firstFree--; }
Deletes the component at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. @param i index of where to remove an object
ObjectVector::removeElementAt
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final void setElementAt(Object value, int index) { m_map[index] = value; }
Sets the component at the specified index of this vector to be the specified object. The previous component at that position is discarded. The index must be a value greater than or equal to 0 and less than the current size of the vector. @param value object to set @param index Index of where to set the object
ObjectVector::setElementAt
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final Object elementAt(int i) { return m_map[i]; }
Get the nth element. @param i index of object to get @return object at given index
ObjectVector::elementAt
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final boolean contains(Object s) { for (int i = 0; i < m_firstFree; i++) { if (m_map[i] == s) return true; } return false; }
Tell if the table contains the given Object. @param s object to look for @return true if the object is in the list
ObjectVector::contains
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final int indexOf(Object elem, int index) { for (int i = index; i < m_firstFree; i++) { if (m_map[i] == elem) return i; } return java.lang.Integer.MIN_VALUE; }
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. @param elem object to look for @param index Index of where to begin search @return the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.
ObjectVector::indexOf
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final int indexOf(Object elem) { for (int i = 0; i < m_firstFree; i++) { if (m_map[i] == elem) return i; } return java.lang.Integer.MIN_VALUE; }
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. @param elem object to look for @return the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.
ObjectVector::indexOf
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final int lastIndexOf(Object elem) { for (int i = (m_firstFree - 1); i >= 0; i--) { if (m_map[i] == elem) return i; } return java.lang.Integer.MIN_VALUE; }
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. @param elem Object to look for @return the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.
ObjectVector::lastIndexOf
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public final void setToSize(int size) { Object newMap[] = new Object[size]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree); m_mapSize = size; m_map = newMap; }
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. @param elem Object to look for @return the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found. public final int lastIndexOf(Object elem) { for (int i = (m_firstFree - 1); i >= 0; i--) { if (m_map[i] == elem) return i; } return java.lang.Integer.MIN_VALUE; } /* Reset the array to the supplied size. @param size
ObjectVector::setToSize
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public Object clone() throws CloneNotSupportedException { return new ObjectVector(this); }
Returns clone of current ObjectVector @return clone of current ObjectVector
ObjectVector::clone
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectVector.java
Apache-2.0
public DefaultErrorHandler(PrintWriter pw) { m_pw = pw; }
Constructor DefaultErrorHandler
DefaultErrorHandler::DefaultErrorHandler
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public DefaultErrorHandler(PrintStream pw) { m_pw = new PrintWriter(pw, true); }
Constructor DefaultErrorHandler
DefaultErrorHandler::DefaultErrorHandler
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public DefaultErrorHandler() { this(true); }
Constructor DefaultErrorHandler
DefaultErrorHandler::DefaultErrorHandler
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public DefaultErrorHandler(boolean throwExceptionOnError) { // Defer creation of a PrintWriter until it's actually needed m_throwExceptionOnError = throwExceptionOnError; }
Constructor DefaultErrorHandler
DefaultErrorHandler::DefaultErrorHandler
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public PrintWriter getErrorWriter() { // Defer creating the java.io.PrintWriter until an error needs to be // reported. if (m_pw == null) { m_pw = new PrintWriter(System.err, true); } return m_pw; }
Retrieve <code>java.io.PrintWriter</code> to which errors are being directed. @return The <code>PrintWriter</code> installed via the constructor or the default <code>PrintWriter</code>
DefaultErrorHandler::getErrorWriter
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public void warning(SAXParseException exception) throws SAXException { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println("Parser warning: " + exception.getMessage()); }
Receive notification of a warning. <p>SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation. The default behaviour is to take no action.</p> <p>The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end.</p> @param exception The warning information encapsulated in a SAX parse exception. @throws SAXException Any SAX exception, possibly wrapping another exception.
DefaultErrorHandler::warning
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public void error(SAXParseException exception) throws SAXException { //printLocation(exception); // getErrorWriter().println(exception.getMessage()); throw exception; }
Receive notification of a recoverable error. <p>This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action.</p> <p>The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML 1.0 recommendation does not require it to do so.</p> @param exception The error information encapsulated in a SAX parse exception. @throws SAXException Any SAX exception, possibly wrapping another exception.
DefaultErrorHandler::error
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public void fatalError(SAXParseException exception) throws SAXException { // printLocation(exception); // getErrorWriter().println(exception.getMessage()); throw exception; }
Receive notification of a non-recoverable error. <p>This corresponds to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a parser would use this callback to report the violation of a well-formedness constraint.</p> <p>The application must assume that the document is unusable after the parser has invoked this method, and should continue (if at all) only for the sake of collecting addition error messages: in fact, SAX parsers are free to stop reporting any other events once this method has been invoked.</p> @param exception The error information encapsulated in a SAX parse exception. @throws SAXException Any SAX exception, possibly wrapping another exception.
DefaultErrorHandler::fatalError
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public void warning(TransformerException exception) throws TransformerException { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println(exception.getMessage()); }
Receive notification of a warning. <p>SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation. The default behaviour is to take no action.</p> <p>The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end.</p> @param exception The warning information encapsulated in a SAX parse exception. @throws javax.xml.transform.TransformerException Any SAX exception, possibly wrapping another exception. @see javax.xml.transform.TransformerException
DefaultErrorHandler::warning
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public void error(TransformerException exception) throws TransformerException { // If the m_throwExceptionOnError flag is true, rethrow the exception. // Otherwise report the error to System.err. if (m_throwExceptionOnError) throw exception; else { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println(exception.getMessage()); } }
Receive notification of a recoverable error. <p>This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action.</p> <p>The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML 1.0 recommendation does not require it to do so.</p> @param exception The error information encapsulated in a SAX parse exception. @throws javax.xml.transform.TransformerException Any SAX exception, possibly wrapping another exception. @see javax.xml.transform.TransformerException
DefaultErrorHandler::error
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public void fatalError(TransformerException exception) throws TransformerException { // If the m_throwExceptionOnError flag is true, rethrow the exception. // Otherwise report the error to System.err. if (m_throwExceptionOnError) throw exception; else { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println(exception.getMessage()); } }
Receive notification of a non-recoverable error. <p>This corresponds to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a parser would use this callback to report the violation of a well-formedness constraint.</p> <p>The application must assume that the document is unusable after the parser has invoked this method, and should continue (if at all) only for the sake of collecting addition error messages: in fact, SAX parsers are free to stop reporting any other events once this method has been invoked.</p> @param exception The error information encapsulated in a SAX parse exception. @throws javax.xml.transform.TransformerException Any SAX exception, possibly wrapping another exception. @see javax.xml.transform.TransformerException
DefaultErrorHandler::fatalError
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java
Apache-2.0
public void setURIResolver(URIResolver resolver) { m_uriResolver = resolver; }
Get the object that will be used to resolve URIs in href in xml-stylesheet processing instruction. @param resolver An object that implements the URIResolver interface, or null.
StylesheetPIHandler::setURIResolver
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
Apache-2.0
public URIResolver getURIResolver() { return m_uriResolver; }
Get the object that will be used to resolve URIs in href in xml-stylesheet processing instruction. @return The URIResolver that was set with setURIResolver.
StylesheetPIHandler::getURIResolver
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
Apache-2.0
public StylesheetPIHandler(String baseID, String media, String title, String charset) { m_baseID = baseID; m_media = media; m_title = title; m_charset = charset; }
Construct a StylesheetPIHandler instance that will search for xml-stylesheet PIs based on the given criteria. @param baseID The base ID of the XML document, needed to resolve relative IDs. @param media The desired media criteria. @param title The desired title criteria. @param charset The desired character set criteria.
StylesheetPIHandler::StylesheetPIHandler
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
Apache-2.0
public Source getAssociatedStylesheet() { int sz = m_stylesheets.size(); if (sz > 0) { Source source = (Source) m_stylesheets.elementAt(sz-1); return source; } else return null; }
Return the last stylesheet found that match the constraints. @return Source object that references the last stylesheet reference that matches the constraints.
StylesheetPIHandler::getAssociatedStylesheet
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
Apache-2.0
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (target.equals("xml-stylesheet")) { String href = null; // CDATA #REQUIRED String type = null; // CDATA #REQUIRED String title = null; // CDATA #IMPLIED String media = null; // CDATA #IMPLIED String charset = null; // CDATA #IMPLIED boolean alternate = false; // (yes|no) "no" StringTokenizer tokenizer = new StringTokenizer(data, " \t=\n", true); boolean lookedAhead = false; Source source = null; String token = ""; while (tokenizer.hasMoreTokens()) { if (!lookedAhead) token = tokenizer.nextToken(); else lookedAhead = false; if (tokenizer.hasMoreTokens() && (token.equals(" ") || token.equals("\t") || token.equals("="))) continue; String name = token; if (name.equals("type")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); type = token.substring(1, token.length() - 1); } else if (name.equals("href")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); href = token; if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); // If the href value has parameters to be passed to a // servlet(something like "foobar?id=12..."), // we want to make sure we get them added to // the href value. Without this check, we would move on // to try to process another attribute and that would be // wrong. // We need to set lookedAhead here to flag that we // already have the next token. while ( token.equals("=") && tokenizer.hasMoreTokens()) { href = href + token + tokenizer.nextToken(); if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); lookedAhead = true; } else { break; } } } href = href.substring(1, href.length() - 1); try { // Add code to use a URIResolver. Patch from Dmitri Ilyin. if (m_uriResolver != null) { source = m_uriResolver.resolve(href, m_baseID); } else { href = SystemIDResolver.getAbsoluteURI(href, m_baseID); source = new SAXSource(new InputSource(href)); } } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } } else if (name.equals("title")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); title = token.substring(1, token.length() - 1); } else if (name.equals("media")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); media = token.substring(1, token.length() - 1); } else if (name.equals("charset")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); charset = token.substring(1, token.length() - 1); } else if (name.equals("alternate")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); alternate = token.substring(1, token.length() - 1).equals("yes"); } } if ((null != type) && (type.equals("text/xsl") || type.equals("text/xml") || type.equals("application/xml+xslt")) && (null != href)) { if (null != m_media) { if (null != media) { if (!media.equals(m_media)) return; } else return; } if (null != m_charset) { if (null != charset) { if (!charset.equals(m_charset)) return; } else return; } if (null != m_title) { if (null != title) { if (!title.equals(m_title)) return; } else return; } m_stylesheets.addElement(source); } } }
Handle the xml-stylesheet processing instruction. @param target The processing instruction target. @param data The processing instruction data, or null if none is supplied. @throws org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#processingInstruction @see <a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents, Version 1.0</a>
StylesheetPIHandler::processingInstruction
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
Apache-2.0
public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws org.xml.sax.SAXException { throw new StopParseException(); }
The spec notes that "The xml-stylesheet processing instruction is allowed only in the prolog of an XML document.", so, at least for right now, I'm going to go ahead an throw a TransformerException in order to stop the parse. @param namespaceURI The Namespace URI, or an empty string. @param localName The local name (without prefix), or empty string if not namespace processing. @param qName The qualified name (with prefix). @param atts The specified or defaulted attributes. @throws StopParseException since there can be no valid xml-stylesheet processing instructions past the first element.
StylesheetPIHandler::startElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
Apache-2.0
public void setBaseId(String baseId) { m_baseID = baseId; }
Added additional getter and setter methods for the Base Id to fix bugzilla bug 24187
StylesheetPIHandler::setBaseId
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java
Apache-2.0
public ObjectStack() { super(); }
Default constructor. Note that the default block size is very small, for small lists.
ObjectStack::ObjectStack
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public ObjectStack(int blocksize) { super(blocksize); }
Construct a ObjectVector, using the given block size. @param blocksize Size of block to allocate
ObjectStack::ObjectStack
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public ObjectStack (ObjectStack v) { super(v); }
Copy constructor for ObjectStack @param v ObjectStack to copy
ObjectStack::ObjectStack
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public Object push(Object i) { if ((m_firstFree + 1) >= m_mapSize) { m_mapSize += m_blocksize; Object newMap[] = new Object[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } m_map[m_firstFree] = i; m_firstFree++; return i; }
Pushes an item onto the top of this stack. @param i the int to be pushed onto this stack. @return the <code>item</code> argument.
ObjectStack::push
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public Object pop() { Object val = m_map[--m_firstFree]; m_map[m_firstFree] = null; return val; }
Removes the object at the top of this stack and returns that object as the value of this function. @return The object at the top of this stack.
ObjectStack::pop
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public Object peek() { try { return m_map[m_firstFree - 1]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
Looks at the object at the top of this stack without removing it from the stack. @return the object at the top of this stack. @throws EmptyStackException if this stack is empty.
ObjectStack::peek
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public Object peek(int n) { try { return m_map[m_firstFree-(1+n)]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
Looks at the object at the position the stack counting down n items. @param n The number of items down, indexed from zero. @return the object at n items down. @throws EmptyStackException if this stack is empty.
ObjectStack::peek
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public void setTop(Object val) { try { m_map[m_firstFree - 1] = val; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
Sets an object at a the top of the statck @param val object to set at the top @throws EmptyStackException if this stack is empty.
ObjectStack::setTop
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public boolean empty() { return m_firstFree == 0; }
Tests if this stack is empty. @return <code>true</code> if this stack is empty; <code>false</code> otherwise. @since JDK1.0
ObjectStack::empty
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public int search(Object o) { int i = lastIndexOf(o); if (i >= 0) { return size() - i; } return -1; }
Returns where an object is on this stack. @param o the desired object. @return the distance from the top of the stack where the object is] located; the return value <code>-1</code> indicates that the object is not on the stack. @since JDK1.0
ObjectStack::search
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public Object clone() throws CloneNotSupportedException { return (ObjectStack) super.clone(); }
Returns clone of current ObjectStack @return clone of current ObjectStack
ObjectStack::clone
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectStack.java
Apache-2.0
public synchronized static FastStringBuffer get() { return (FastStringBuffer) m_stringBufPool.getInstance(); }
Get the first free instance of a string buffer, or create one if there are no free instances. @return A string buffer ready for use.
StringBufferPool::get
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StringBufferPool.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StringBufferPool.java
Apache-2.0
public synchronized static void free(FastStringBuffer sb) { // Since this isn't synchronized, setLength must be // done before the instance is freed. // Fix attributed to Peter Speck <[email protected]>. sb.setLength(0); m_stringBufPool.freeInstance(sb); }
Return a string buffer back to the pool. @param sb Must be a non-null reference to a string buffer.
StringBufferPool::free
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StringBufferPool.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/StringBufferPool.java
Apache-2.0
public NodeVector() { m_blocksize = 32; m_mapSize = 0; }
Default constructor.
NodeVector::NodeVector
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public NodeVector(int blocksize) { m_blocksize = blocksize; m_mapSize = 0; }
Construct a NodeVector, using the given block size. @param blocksize Size of blocks to allocate
NodeVector::NodeVector
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public Object clone() throws CloneNotSupportedException { NodeVector clone = (NodeVector) super.clone(); if ((null != this.m_map) && (this.m_map == clone.m_map)) { clone.m_map = new int[this.m_map.length]; System.arraycopy(this.m_map, 0, clone.m_map, 0, this.m_map.length); } return clone; }
Get a cloned LocPathIterator. @return A clone of this @throws CloneNotSupportedException
NodeVector::clone
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public int size() { return m_firstFree; }
Get the length of the list. @return Number of nodes in this NodeVector
NodeVector::size
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void addElement(int value) { if ((m_firstFree + 1) >= m_mapSize) { if (null == m_map) { m_map = new int[m_blocksize]; m_mapSize = m_blocksize; } else { m_mapSize += m_blocksize; int newMap[] = new int[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } } m_map[m_firstFree] = value; m_firstFree++; }
Append a Node onto the vector. @param value Node to add to the vector
NodeVector::addElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final void push(int value) { int ff = m_firstFree; if ((ff + 1) >= m_mapSize) { if (null == m_map) { m_map = new int[m_blocksize]; m_mapSize = m_blocksize; } else { m_mapSize += m_blocksize; int newMap[] = new int[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, ff + 1); m_map = newMap; } } m_map[ff] = value; ff++; m_firstFree = ff; }
Append a Node onto the vector. @param value Node to add to the vector
NodeVector::push
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final int pop() { m_firstFree--; int n = m_map[m_firstFree]; m_map[m_firstFree] = DTM.NULL; return n; }
Pop a node from the tail of the vector and return the result. @return the node at the tail of the vector
NodeVector::pop
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final int popAndTop() { m_firstFree--; m_map[m_firstFree] = DTM.NULL; return (m_firstFree == 0) ? DTM.NULL : m_map[m_firstFree - 1]; }
Pop a node from the tail of the vector and return the top of the stack after the pop. @return The top of the stack after it's been popped
NodeVector::popAndTop
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final void popQuick() { m_firstFree--; m_map[m_firstFree] = DTM.NULL; }
Pop a node from the tail of the vector.
NodeVector::popQuick
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final int peepOrNull() { return ((null != m_map) && (m_firstFree > 0)) ? m_map[m_firstFree - 1] : DTM.NULL; }
Return the node at the top of the stack without popping the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical. @return Node at the top of the stack or null if stack is empty.
NodeVector::peepOrNull
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final void pushPair(int v1, int v2) { if (null == m_map) { m_map = new int[m_blocksize]; m_mapSize = m_blocksize; } else { if ((m_firstFree + 2) >= m_mapSize) { m_mapSize += m_blocksize; int newMap[] = new int[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree); m_map = newMap; } } m_map[m_firstFree] = v1; m_map[m_firstFree + 1] = v2; m_firstFree += 2; }
Push a pair of nodes into the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical. @param v1 First node to add to vector @param v2 Second node to add to vector
NodeVector::pushPair
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final void popPair() { m_firstFree -= 2; m_map[m_firstFree] = DTM.NULL; m_map[m_firstFree + 1] = DTM.NULL; }
Pop a pair of nodes from the tail of the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.
NodeVector::popPair
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final void setTail(int n) { m_map[m_firstFree - 1] = n; }
Set the tail of the stack to the given node. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical. @param n Node to set at the tail of vector
NodeVector::setTail
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final void setTailSub1(int n) { m_map[m_firstFree - 2] = n; }
Set the given node one position from the tail. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical. @param n Node to set
NodeVector::setTailSub1
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final int peepTail() { return m_map[m_firstFree - 1]; }
Return the node at the tail of the vector without popping Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical. @return Node at the tail of the vector
NodeVector::peepTail
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public final int peepTailSub1() { return m_map[m_firstFree - 2]; }
Return the node one position from the tail without popping. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical. @return Node one away from the tail
NodeVector::peepTailSub1
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void insertInOrder(int value) { for (int i = 0; i < m_firstFree; i++) { if (value < m_map[i]) { insertElementAt(value, i); return; } } addElement(value); }
Insert a node in order in the list. @param value Node to insert
NodeVector::insertInOrder
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void insertElementAt(int value, int at) { if (null == m_map) { m_map = new int[m_blocksize]; m_mapSize = m_blocksize; } else if ((m_firstFree + 1) >= m_mapSize) { m_mapSize += m_blocksize; int newMap[] = new int[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } if (at <= (m_firstFree - 1)) { System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at); } m_map[at] = value; m_firstFree++; }
Inserts the specified node in this vector at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously. @param value Node to insert @param at Position where to insert
NodeVector::insertElementAt
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void appendNodes(NodeVector nodes) { int nNodes = nodes.size(); if (null == m_map) { m_mapSize = nNodes + m_blocksize; m_map = new int[m_mapSize]; } else if ((m_firstFree + nNodes) >= m_mapSize) { m_mapSize += (nNodes + m_blocksize); int newMap[] = new int[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + nNodes); m_map = newMap; } System.arraycopy(nodes.m_map, 0, m_map, m_firstFree, nNodes); m_firstFree += nNodes; }
Append the nodes to the list. @param nodes NodeVector to append to this list
NodeVector::appendNodes
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void removeAllElements() { if (null == m_map) return; for (int i = 0; i < m_firstFree; i++) { m_map[i] = DTM.NULL; } m_firstFree = 0; }
Inserts the specified node in this vector at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.
NodeVector::removeAllElements
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void RemoveAllNoClear() { if (null == m_map) return; m_firstFree = 0; }
Set the length to zero, but don't clear the array.
NodeVector::RemoveAllNoClear
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public boolean removeElement(int s) { if (null == m_map) return false; for (int i = 0; i < m_firstFree; i++) { int node = m_map[i]; if (node == s) { if (i > m_firstFree) System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i); else m_map[i] = DTM.NULL; m_firstFree--; return true; } } return false; }
Removes the first occurrence of the argument from this vector. If the object is found in this vector, each component in the vector with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously. @param s Node to remove from the list @return True if the node was successfully removed
NodeVector::removeElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void removeElementAt(int i) { if (null == m_map) return; if (i > m_firstFree) System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i); else m_map[i] = DTM.NULL; }
Deletes the component at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. @param i Index of node to remove
NodeVector::removeElementAt
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void setElementAt(int node, int index) { if (null == m_map) { m_map = new int[m_blocksize]; m_mapSize = m_blocksize; } if(index == -1) addElement(node); m_map[index] = node; }
Sets the component at the specified index of this vector to be the specified object. The previous component at that position is discarded. The index must be a value greater than or equal to 0 and less than the current size of the vector. @param node Node to set @param index Index of where to set the node
NodeVector::setElementAt
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public int elementAt(int i) { if (null == m_map) return DTM.NULL; return m_map[i]; }
Get the nth element. @param i Index of node to get @return Node at specified index
NodeVector::elementAt
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public boolean contains(int s) { if (null == m_map) return false; for (int i = 0; i < m_firstFree; i++) { int node = m_map[i]; if (node == s) return true; } return false; }
Tell if the table contains the given node. @param s Node to look for @return True if the given node was found.
NodeVector::contains
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public int indexOf(int elem, int index) { if (null == m_map) return -1; for (int i = index; i < m_firstFree; i++) { int node = m_map[i]; if (node == elem) return i; } return -1; }
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. @param elem Node to look for @param index Index of where to start the search @return the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.
NodeVector::indexOf
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public int indexOf(int elem) { if (null == m_map) return -1; for (int i = 0; i < m_firstFree; i++) { int node = m_map[i]; if (node == elem) return i; } return -1; }
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. @param elem Node to look for @return the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.
NodeVector::indexOf
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void sort(int a[], int lo0, int hi0) throws Exception { int lo = lo0; int hi = hi0; // pause(lo, hi); if (lo >= hi) { return; } else if (lo == hi - 1) { /* * sort a two element list by swapping if necessary */ if (a[lo] > a[hi]) { int T = a[lo]; a[lo] = a[hi]; a[hi] = T; } return; } /* * Pick a pivot and move it out of the way */ int pivot = a[(lo + hi) / 2]; a[(lo + hi) / 2] = a[hi]; a[hi] = pivot; while (lo < hi) { /* * Search forward from a[lo] until an element is found that * is greater than the pivot or lo >= hi */ while (a[lo] <= pivot && lo < hi) { lo++; } /* * Search backward from a[hi] until element is found that * is less than the pivot, or lo >= hi */ while (pivot <= a[hi] && lo < hi) { hi--; } /* * Swap elements a[lo] and a[hi] */ if (lo < hi) { int T = a[lo]; a[lo] = a[hi]; a[hi] = T; // pause(); } // if (stopRequested) { // return; // } } /* * Put the median in the "center" of the list */ a[hi0] = a[hi]; a[hi] = pivot; /* * Recursive calls, elements a[lo0] to a[lo-1] are less than or * equal to pivot, elements a[hi+1] to a[hi0] are greater than * pivot. */ sort(a, lo0, lo - 1); sort(a, hi + 1, hi0); }
Sort an array using a quicksort algorithm. @param a The array to be sorted. @param lo0 The low index. @param hi0 The high index. @throws Exception
NodeVector::sort
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0
public void sort() throws Exception { sort(m_map, 0, m_firstFree - 1); }
Sort an array using a quicksort algorithm. @throws Exception
NodeVector::sort
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/NodeVector.java
Apache-2.0