public int getSiblingNameIndex() { initSiblingNames(); return siblingNameIndex; }
/** * Returns this node's previous sibling element with the same name. */ public Node getPreviousSiblingName() { if (nodeName == null) { return null; } initSiblingNames(); int index = siblingNameIndex -1; for (int i = siblingIndex; i >= 0; i--) { Node sibling = parentNode.childNodes.get(i); if ((index == sibling.siblingNameIndex) && nodeName.equals(sibling.getNodeName())) { return sibling; } } return null; }
/** * Returns first child <b>element</b> with given name or * <code>null</code> if no such children exist. */ public Element getFirstChildElement(final String elementName) { if (childNodes == null) { return null; } for (int i = 0, childNodesSize = childNodes.size(); i < childNodesSize; i++) { Node child = childNodes.get(i); if (child.getNodeType() == NodeType.ELEMENT && elementName.equals(child.getNodeName())) { child.initSiblingNames(); return (Element) child; } } return null; }
/** * Returns last child <b>element</b> with given name or * <code>null</code> if no such child node exist. */ public Element getLastChildElement(final String elementName) { if (childNodes == null) { return null; } int from = childNodes.size() - 1; for (int i = from; i >= 0; i--) { Node child = childNodes.get(i); if (child.getNodeType() == NodeType.ELEMENT && elementName.equals(child.getNodeName())) { child.initSiblingNames(); return (Element) child; } } return null; }
/** * Returns this node's next <b>element</b> with the same name. */ public Node getNextSiblingName() { if (nodeName == null) { return null; } initSiblingNames(); int index = siblingNameIndex + 1; int max = parentNode.getChildNodesCount(); for (int i = siblingIndex + 1; i < max; i++) { Node sibling = parentNode.childNodes.get(i); if ((index == sibling.siblingNameIndex) && nodeName.equals(sibling.getNodeName())) { return sibling; } } return null; }
public int getSiblingNameIndex() { initSiblingNames(); return siblingNameIndex; }
public int getSiblingNameIndex() { initSiblingNames(); return siblingNameIndex; }
public int getSiblingNameIndex() { initSiblingNames(); return siblingNameIndex; }
/** * Returns first child <b>element</b> with given name or * <code>null</code> if no such children exist. */ public Node getFirstChildElement(String elementName) { if (childNodes == null) { return null; } for (int i = 0, childNodesSize = childNodes.size(); i < childNodesSize; i++) { Node child = childNodes.get(i); if (elementName.equals(child.getNodeName())) { child.initSiblingNames(); return child; } } return null; }
/** * Returns this node's previous sibling element with the same name. */ public Node getPreviousSiblingName() { if (nodeName == null) { return null; } initSiblingNames(); int index = siblingNameIndex -1; for (int i = siblingIndex; i >= 0; i--) { Node sibling = parentNode.childNodes.get(i); if ((index == sibling.siblingNameIndex) && nodeName.equals(sibling.getNodeName())) { return sibling; } } return null; }
/** * Returns this node's previous sibling element with the same name. */ public Node getPreviousSiblingName() { if (nodeName == null) { return null; } initSiblingNames(); int index = siblingNameIndex -1; for (int i = siblingIndex; i >= 0; i--) { Node sibling = parentNode.childNodes.get(i); if ((index == sibling.siblingNameIndex) && nodeName.equals(sibling.getNodeName())) { return sibling; } } return null; }
/** * Returns this node's previous sibling element with the same name. */ public Node getPreviousSiblingName() { if (nodeName == null) { return null; } initSiblingNames(); int index = siblingNameIndex - 1; for (int i = siblingIndex; i >= 0; i--) { Node sibling = parentNode.childNodes.get(i); if ((index == sibling.siblingNameIndex) && nodeName.equals(sibling.getNodeName())) { return sibling; } } return null; }
/** * Returns last child <b>element</b> with given name or * <code>null</code> if no such child node exist. */ public Node getLastChildElement(String elementName) { if (childNodes == null) { return null; } int from = childNodes.size() - 1; for (int i = from; i >= 0; i--) { Node child = childNodes.get(i); if (elementName.equals(child.getNodeName())) { child.initSiblingNames(); return child; } } return null; }
/** * Returns first child <b>element</b> with given name or * <code>null</code> if no such children exist. */ public Element getFirstChildElement(final String elementName) { if (childNodes == null) { return null; } for (int i = 0, childNodesSize = childNodes.size(); i < childNodesSize; i++) { Node child = childNodes.get(i); if (child.getNodeType() == NodeType.ELEMENT && elementName.equals(child.getNodeName())) { child.initSiblingNames(); return (Element) child; } } return null; }
/** * Returns last child <b>element</b> with given name or * <code>null</code> if no such child node exist. */ public Element getLastChildElement(String elementName) { if (childNodes == null) { return null; } int from = childNodes.size() - 1; for (int i = from; i >= 0; i--) { Node child = childNodes.get(i); if (child.getNodeType() == NodeType.ELEMENT && elementName.equals(child.getNodeName())) { child.initSiblingNames(); return (Element) child; } } return null; }
/** * Returns first child <b>element</b> with given name or * <code>null</code> if no such children exist. */ public Element getFirstChildElement(String elementName) { if (childNodes == null) { return null; } for (int i = 0, childNodesSize = childNodes.size(); i < childNodesSize; i++) { Node child = childNodes.get(i); if (child.getNodeType() == NodeType.ELEMENT && elementName.equals(child.getNodeName())) { child.initSiblingNames(); return (Element) child; } } return null; }
/** * Returns last child <b>element</b> with given name or * <code>null</code> if no such child node exist. */ public Element getLastChildElement(final String elementName) { if (childNodes == null) { return null; } int from = childNodes.size() - 1; for (int i = from; i >= 0; i--) { Node child = childNodes.get(i); if (child.getNodeType() == NodeType.ELEMENT && elementName.equals(child.getNodeName())) { child.initSiblingNames(); return (Element) child; } } return null; }
/** * Returns this node's next <b>element</b> with the same name. */ public Node getNextSiblingName() { if (nodeName == null) { return null; } initSiblingNames(); int index = siblingNameIndex + 1; int max = parentNode.getChildNodesCount(); for (int i = siblingIndex + 1; i < max; i++) { Node sibling = parentNode.childNodes.get(i); if ((index == sibling.siblingNameIndex) && nodeName.equals(sibling.getNodeName())) { return sibling; } } return null; }
/** * Returns this node's next <b>element</b> with the same name. */ public Node getNextSiblingName() { if (nodeName == null) { return null; } initSiblingNames(); int index = siblingNameIndex + 1; int max = parentNode.getChildNodesCount(); for (int i = siblingIndex + 1; i < max; i++) { Node sibling = parentNode.childNodes.get(i); if ((index == sibling.siblingNameIndex) && nodeName.equals(sibling.getNodeName())) { return sibling; } } return null; }
/** * Returns this node's next <b>element</b> with the same name. */ public Node getNextSiblingName() { if (nodeName == null) { return null; } initSiblingNames(); int index = siblingNameIndex + 1; int max = parentNode.getChildNodesCount(); for (int i = siblingIndex + 1; i < max; i++) { Node sibling = parentNode.childNodes.get(i); if ((index == sibling.siblingNameIndex) && nodeName.equals(sibling.getNodeName())) { return sibling; } } return null; }