删除节点

@param node
177308
public void removeNode(Node node) {
        Set<TaskTrackerNode> taskTrackerNodes = NODE_MAP.get(node.getGroup());
        if (taskTrackerNodes != null && taskTrackerNodes.size() != 0) {
            TaskTrackerNode taskTrackerNode = new TaskTrackerNode(node.getIdentity());
            taskTrackerNode.setNodeGroup(node.getGroup());
            LOGGER.info("Remove TaskTracker node:{}", taskTrackerNode);
            taskTrackerNodes.remove(taskTrackerNode);
        }
    }
304176
public void remove(int node) {
        if (node == NIL) {
            throw new IllegalArgumentException();
        }
        if (left(node) != NIL && right(node) != NIL) {
            // inner node
            final int next = next(node);
            assert next != NIL;
            swap(node, next);
        }
        assert left(node) == NIL || right(node) == NIL;

        final int parent = parent(node);
        int child = left(node);
        if (child == NIL) {
            child = right(node);
        }

        if (child == NIL) {
            // no children
            if (node == root) {
                assert size() == 1 : size();
                root = NIL;
            } else {
                if (node == left(parent)) {
                    left(parent, NIL);
                } else {
                    assert node == right(parent);
                    right(parent, NIL);
                }
            }
        } else {
            // one single child
            if (node == root) {
                assert size() == 2;
                root = child;
            } else if (node == left(parent)) {
                left(parent, child);
            } else {
                assert node == right(parent);
                right(parent, child);
            }
            parent(child, parent);
        }

        release(node);
        rebalance(parent);
    }
739666
@Override
	protected void parse(Node node) {
		NamedNodeMap attributes = node.getAttributes();
		order = getValueRecursiveAsInteger(attributes.getNamedItem("order"));
		unitsPerPixel = getValueRecursiveAsDouble(attributes.getNamedItem("units-per-pixel"));
		href = getValueRecursive(attributes.getNamedItem("href"));
		setParsed(true);
	}
776269
public void startScanNode(SiteNode node) {
		Target target = new Target(node);
		target.setRecurse(true);
		this.startScan(target, null, null);
	}
804073
protected void clip(Node node, int type) {
        if(node.getNodeType() != NodeType.TEXT) {
            return;
        }

        char c;
        int j = 0;
        String content = node.getTextContent();

        if(type == 1) {
            /**
             * 删除该文本节点的后缀空格
             * 也就是删除下�?��标签节点的前导空�?             * 只删除空格不删除其他不可见字�?             */
            for(j = content.length() - 1; j > -1; j--) {
                c = content.charAt(j);

                if(c == ' ' || c == '\t') {
                    continue;
                }
                else {
                    break;
                }
            }
            content = content.substring(0, j + 1);
        }
        else {
            /**
             * 删除该文本节点的前导回车
             * 也就是删除前�?��标签节点的后�?���?             * 只删除回车不删除其他不可见字�?             */
            int length = content.length();

            for(j = 0; j < length; j++) {
                c = content.charAt(j);

                if(c == '\r') {
                    continue;
                }
                else if(c == '\n') {
                    j++;
                    break;
                }
                else {
                    break;
                }
            }

            if(j <= length) {
                content = content.substring(j, length);
            }
        }
        ((TextNode)node).setTextContent(content);
    }
444241
private void extractProperties(final Node node) {

		for (final String key : node.getPropertyKeys()) {

			final Object value = node.getProperty(key);
			if (value != null) {
				properties.put(key, value.getClass());
			}
		}
	}
284808
@Override
	protected void parse(Node node) {
		NamedNodeMap attributes = node.getAttributes();
		title = getValueRecursive(attributes.getNamedItem("title"));
		srs = getValueRecursive(attributes.getNamedItem("srs"));
		profile = getValueRecursive(attributes.getNamedItem("profile"));
		href = getValueRecursive(attributes.getNamedItem("href"));
		setParsed(true);
	}
646620
public void connect(Node<T> o, Node<T> t) {
    if (!o.equals(t)) {
      o.connectTo(t);
      t.connectTo(o);
    }
  }
483434
function (node) {
        if (node.nodeType != 1 || !dtd.$removeEmpty[ node.tagName ]) {
            return 0;
        }
        node = node.firstChild;
        while (node) {
            //如果是创建的bookmark就跳过
            if (domUtils.isBookmarkNode(node)) {
                return 0;
            }
            if (node.nodeType == 1 && !domUtils.isEmptyInlineElement(node) ||
                node.nodeType == 3 && !domUtils.isWhitespace(node)
                ) {
                return 0;
            }
            node = node.nextSibling;
        }
        return 1;

    }
1158208
final public function setNode(Node $node)
    {
        $this->node = $node;
        foreach ($node->getParams() as $key => $value) {
            $this->$key = $value;
        }
    }
426949
protected void initListener(XmlParser.Node node)
    {
        String className=node.getString("listener-class",false,true);
        Object listener=null;
        try
        {
            Class listenerClass=getWebApplicationContext().loadClass(className);
            listener=listenerClass.newInstance();
        }
        catch(Exception e)
        {
            log.warn("Could not instantiate listener "+className,e);
            return;
        }
        if(!(listener instanceof EventListener))
        {
            log.warn("Not an EventListener: "+listener);
            return;
        }
        boolean known=false;
        try
        {
            getWebApplicationContext().addEventListener((EventListener)listener);
            known=true;
        }
        catch(Exception e)
        {
            LogSupport.ignore(log,e);
        }
        try
        {
            getWebApplicationHandler().addEventListener((EventListener)listener);
            known=true;
        }
        catch(Exception e)
        {
            LogSupport.ignore(log,e);
        }
        if(!known)
            log.warn("Unknown: "+listener);
    }
303664
private void add(Node node) {
    evict();

    if (handHot == null) {
      handHot = handCold = handTest = node;
      node.next = node.prev = node;
    } else {
      node.prev = handHot;
      node.next = handHot.next;
      handHot.next.prev = node;
      handHot.next = node;
    }
    if (handCold == handHot) {
      handCold = node.next;
    }
    if (handTest == handHot) {
      handTest = node.next;
    }
    handHot = node.next;
  }
1362528
private void summariseNode(final ObjectGraphNode node) {
		int size = node.getSize();
		node.removeAll();
		node.setSize(size);
	}
796111
def delete_node(self, node: str):
        
        if self.has_node(node):
            self.remove_node(node)
522551
public void add(final LeftTupleSinkNode node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;;
        } else {
            this.lastNode.setNextLeftTupleSinkNode( node );
            node.setPreviousLeftTupleSinkNode( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }
699093
protected void parse(Node node) {
		NamedNodeMap attributes = node.getAttributes();
		type = getValueRecursive(attributes.getNamedItem("type"));

		NodeList childNodes = node.getChildNodes();
		for (int i = 0; i < childNodes.getLength(); i++) {
			Node child = childNodes.item(i);
			String nodeName = child.getNodeName();
			if ("Format".equalsIgnoreCase(nodeName)) {
				format = getValueRecursive(child);
			} else if ("OnlineResource".equalsIgnoreCase(nodeName)) {
				onlineResource = createOnlineResource(child);
			}
		}
	}
254236
protected void endNode(int node) throws org.xml.sax.SAXException
  {

    switch (m_dtm.getNodeType(node))
    {
    case DTM.DOCUMENT_NODE :
      this.m_contentHandler.endDocument();
      break;
    case DTM.ELEMENT_NODE :
      String ns = m_dtm.getNamespaceURI(node);
      if(null == ns)
        ns = "";
      this.m_contentHandler.endElement(ns,
                                         m_dtm.getLocalName(node),
                                         m_dtm.getNodeName(node));

      for (int nsn = m_dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn;
           nsn = m_dtm.getNextNamespaceNode(node, nsn, true))
      {
        // String prefix = m_dtm.getPrefix(nsn);
        String prefix = m_dtm.getNodeNameX(nsn);

        this.m_contentHandler.endPrefixMapping(prefix);
      }
      break;
    case DTM.CDATA_SECTION_NODE :
      break;
    case DTM.ENTITY_REFERENCE_NODE :
    {
      if (m_contentHandler instanceof LexicalHandler)
      {
        LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);

        lh.endEntity(m_dtm.getNodeName(node));
      }
    }
    break;
    default :
    }
  }