protected int getNamedItemIndex(String namespaceURI, String localName) { return findNamePoint(namespaceURI, localName); }
public Node removeNamedItem(String name) throws DOMException { // TODO Set used to false return super.removeNamedItem(name); }
public Node removeNamedItemNS(String namespaceURI, String name) throws DOMException { // TODO return super.removeNamedItemNS(namespaceURI, name); }
/***/ public Node removeNamedItem(String name) throws DOMException { if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } int i = findNamePoint(name, 0); if (i < 0) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } NodeImpl n = (NodeImpl) nodes.elementAt(i); nodes.removeElementAt(i); return n; } // removeNamedItem(String):Node
if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, int i = findNamePoint(arg.getNamespaceURI(), arg.getLocalName()); NodeImpl previous = null; if (i >= 0) { i = findNamePoint(arg.getNodeName(), 0); if (i >= 0) { previous = (NodeImpl) nodes.elementAt(i);
/** * Introduced in DOM Level 2. Removes a node specified by local name and namespace URI. * * @param namespaceURI The namespace URI of the node to remove. When it is null or an empty * string, this method behaves like removeNamedItem. * @param name The local name of the node to remove. * @return Returns the node removed from the map if a node with such a local name and namespace * URI exists. * @throws NOT_FOUND_ERR: Raised if there is no node named name in the map. */ public Node removeNamedItemNS(String namespaceURI, String name) throws DOMException { if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } int i = findNamePoint(namespaceURI, name); if (i < 0) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } NodeImpl n = (NodeImpl) nodes.elementAt(i); nodes.removeElementAt(i); return n; } // removeNamedItem(String):Node
/** * */ public Node getNamedItem(String name) { int i = findNamePoint(name, 0); return (i < 0) ? null : (Node) (nodes.elementAt(i)); }
.getOwnerDocument(); if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, int i = findNamePoint(arg.getNodeName(), 0); NodeImpl previous = null; if (i >= 0) {
/** * Introduced in DOM Level 2. Retrieves a node specified by local name and namespace URI. * * @param namespaceURI The namespace URI of the node to retrieve. When it is null or an empty * string, this method behaves like getNamedItem. * @param localName The local name of the node to retrieve. * @return Returns s Node (of any type) with the specified name, or null if the specified name * did not identify any node in the map. */ public Node getNamedItemNS(String namespaceURI, String localName) { int i = findNamePoint(namespaceURI, localName); return (i < 0) ? null : (Node) (nodes.elementAt(i)); } // getNamedItemNS(String,String):Node
protected int addItem(Node arg) { int i = findNamePoint(arg.getNamespaceURI(), arg.getLocalName()); if (i >= 0) { nodes.setElementAt(arg, i); } else { // If we can't find by namespaceURI, localName, then we find by // nodeName so we know where to insert. i = findNamePoint(arg.getNodeName(), 0); if (i >= 0) { nodes.insertElementAt(arg, i); } else { i = -1 - i; // Insert point (may be end of list) if (null == nodes) { nodes = new Vector(5, 10); } nodes.insertElementAt(arg, i); } } return i; }