增加节点<br>
每增加一个节点，就会在闭环上增加给定复制节点数<br>
例如复制节点数是2，则每调用此方法一次，增加两个虚拟节点，这两个节点指向同一Node
由于hash算法会调用node的toString方法，故按照toString去重
@param node 节点对象
359042
public void add(T node) {
		for (int i = 0; i < numberOfReplicas; i++) {
			circle.put(hashFunc.hash(node.toString() + i), node);
		}
	}
1298540
private void writeNode(Node node) {
        try {
            this.pStmtNodesC.setLong(1, node.getId());
            this.pStmtNodesC.setDouble(2, node.getLatitude());
            this.pStmtNodesC.setDouble(3, node.getLongitude());

            this.pStmtNodesC.addBatch();

            if (this.nNodes % BATCH_LIMIT == 0) {
                this.pStmtNodesC.executeBatch();

                this.pStmtNodesC.clearBatch();
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
1280217
public void addLast(final T node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            T currentLast = this.lastNode;
            currentLast.setNext( node );
            node.setPrevious( currentLast );
            this.lastNode = node;            
        }
        
        this.size++;
    }
1338500
public void addChild(Node node) throws ChildNodeException {
    if (node != null) {
      if (!allowChildren) {
        throw new ChildNodeException();
      }

      if (getFirstChild() == null) {
        setFirstChild(node);
        getFirstChild().setPrevSibling(firstChild);
        getFirstChild().setNextSibling(firstChild);
      } else {    // Add it to the end of the list
        Node lastChild = getFirstChild().getPrevSibling();
        if (lastChild != null) {
          lastChild.setNextSibling(node);
        }
        node.setNextSibling(getFirstChild());
      }
      node.setParent(this);
    }
  }
35016
public static boolean hasHtmlNodes(Node node) {
    return hasNodesOfType(
        node,
        HtmlOpenTagNode.class,
        HtmlCloseTagNode.class,
        HtmlCommentNode.class,
        HtmlAttributeNode.class,
        HtmlAttributeValueNode.class);
  }
302124
private void insert(String key, RadixTreeNode<T> node, T value)
            throws DuplicateKeyException {

        int numberOfMatchingCharacters = node.getNumberOfMatchingCharacters(key);

        // we are either at the root node
        // or we need to go down the tree
        if (node.getKey().equals("") == true || numberOfMatchingCharacters == 0 || (numberOfMatchingCharacters < key.length() && numberOfMatchingCharacters >= node.getKey().length())) {
            boolean flag = false;
            String newText = key.substring(numberOfMatchingCharacters, key.length());
            for (RadixTreeNode<T> child : node.getChildern()) {
                if (child.getKey().startsWith(newText.charAt(0) + "")) {
                    flag = true;
                    insert(newText, child, value);
                    break;
                }
            }

            // just add the node as the child of the current node
            if (flag == false) {
                RadixTreeNode<T> n = new RadixTreeNode<T>();
                n.setKey(newText);
                n.setReal(true);
                n.setValue(value);

                node.getChildern().add(n);
            }
        }
        // there is a exact match just make the current node as data node
        else if (numberOfMatchingCharacters == key.length() && numberOfMatchingCharacters == node.getKey().length()) {
            if (node.isReal() == true) {
                throw new DuplicateKeyException("Duplicate key");
            }

            node.setReal(true);
            node.setValue(value);
        }
        // This node need to be split as the key to be inserted
        // is a prefix of the current node key
        else if (numberOfMatchingCharacters > 0 && numberOfMatchingCharacters < node.getKey().length()) {
            RadixTreeNode<T> n1 = new RadixTreeNode<T>();
            n1.setKey(node.getKey().substring(numberOfMatchingCharacters, node.getKey().length()));
            n1.setReal(node.isReal());
            n1.setValue(node.getValue());
            n1.setChildern(node.getChildern());

            node.setKey(key.substring(0, numberOfMatchingCharacters));
            node.setReal(false);
            node.setChildern(new ArrayList<RadixTreeNode<T>>());
            node.getChildern().add(n1);
            
            if(numberOfMatchingCharacters < key.length()) {
	            RadixTreeNode<T> n2 = new RadixTreeNode<T>();
	            n2.setKey(key.substring(numberOfMatchingCharacters, key.length()));
	            n2.setReal(true);
	            n2.setValue(value);
	            
	            node.getChildern().add(n2);
            } else {
            	node.setValue(value);
                node.setReal(true);
            }
        }        
        // this key need to be added as the child of the current node
        else {
            RadixTreeNode<T> n = new RadixTreeNode<T>();
            n.setKey(node.getKey().substring(numberOfMatchingCharacters, node.getKey().length()));
            n.setChildern(node.getChildern());
            n.setReal(node.isReal());
            n.setValue(node.getValue());

            node.setKey(key);
            node.setReal(true);
            node.setValue(value);

            node.getChildern().add(n);
        }
    }
1051578
public Tree<T> add(Tree<T> node) {
    node.removeFromParent();
    node.parent = this;
    children.add(node);
    return node;
  }
615002
public void update(int node) {
        final int prev = prev(node);
        final int next = next(node);
        if ((prev == NIL || compare(prev) > 0) && (next == NIL || compare(next) < 0)) {
            // Update can be done in-place
            copy(node);
            for (int n = node; n != NIL; n = parent(n)) {
                fixAggregates(n);
            }
        } else {
            // TODO: it should be possible to find the new node position without
            // starting from scratch
            remove(node);
            add();
        }
    }
614956
public static String node2String(final Node node) throws UnsupportedEncodingException
   {
      return node2String(node, true, Constants.DEFAULT_XML_CHARSET);
   }
949160
public Node addNode(Node subNode) {
		if (this instanceof Node) {
			subNode.parentNode = (Node) this;
		}
		contents.add(subNode);
		return subNode;
	}
1213924
function(node) {

	if( node instanceof NWTNodeInstance ) {
		node = node._node;
	}

	var child = this.one('*');

	this._node.insertBefore(node, (child._node? child._node : null));
	
	return this;
}
734260
@Override
    public void addBatch(Node node)
    {
        if (node != null)
        {
            nodes.add(node);
        }

        onBatchLimit();

    }
686218
public void processChildren(Node node) {
		for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor.getNext()) {
			if (cursor.getType() == Token.CALL) {
				// The node is a function or method call
				Node name = cursor.getFirstChild();
				if (name != null && name.getType() == Token.NAME && // named function call
						name.getString().equals("define")) { // name is "define" //$NON-NLS-1$
					Node param = name.getNext();
					if (param != null && param.getType() != Token.STRING) {
						String expname = name.getProp(Node.SOURCENAME_PROP).toString();
						if (source != null) {
							PositionLocator locator = source.locate(name.getLineno(), name.getCharno()+6);
							char tok = locator.findNextJSToken();	// move cursor to the open paren
							if (tok == '(') {
								// Try to insert the module name immediately following the open paren for the
								// define call because the param location will be off if the argument list is parenthesized.
								source.insert("\"" + expname + "\",", locator.getLineno(), locator.getCharno()+1); //$NON-NLS-1$ //$NON-NLS-2$
							} else {
								// First token following 'define' name is not a paren, so fall back to inserting
								// before the first parameter.
								source.insert("\"" + expname + "\",", param.getLineno(), param.getCharno()); //$NON-NLS-1$ //$NON-NLS-2$
							}
						}
						param.getParent().addChildBefore(Node.newString(expname), param);
					}
				}
			}
			// Recursively call this method to process the child nodes
			if (cursor.hasChildren())
				processChildren(cursor);
		}
	}
422994
function stringifyNode(node)
{
	var result = "<"+node.nodeName;
	var numAttrs = node.attrs.length;
	
	for (var i=0; i<numAttrs; i++)
	{
		result += " "+ node.attrs[i].name +'="'+ node.attrs[i].value +'"';
	}
	
	result += ">";
	
	return result;
}
293468
public void add(XmlReader node)
    {
        Check.notNull(node);

        final Element element = node.getElement();
        document.adoptNode(element);
        root.appendChild(element);
    }
432701
private void insertNode(PatriciaNode<V> node) {
        PatriciaNode<V> current = root.getLeft();
        PatriciaNode<V> parent = root;

        while (parent.getBit() < current.getBit() && current.getBit() < node.getBit()) {
            parent = current;
            if (!keyMapper.isSet(current.getBit(), node.getKey())) {
                current = current.getLeft();
            } else {
                current = current.getRight();
            }
        }

        if (!keyMapper.isSet(node.getBit(), node.getKey())) {
            node.setLeft(node);
            node.setRight(current);
        } else {
            node.setLeft(current);
            node.setRight(node);
        }

        if (!keyMapper.isSet(parent.getBit(), node.getKey())) {
            parent.setLeft(node);
        } else {
            parent.setRight(node);
        }
    }
1249459
public void addNode(final @Nonnull Node node) throws IOException {
        Node oldNode = nodes.get(node.getNodeName());
        if (node != oldNode) {
            // TODO we should not need to lock the queue for adding nodes but until we have a way to update the
            // computer list for just the new node
            Queue.withLock(new Runnable() {
                @Override
                public void run() {
                    nodes.put(node.getNodeName(), node);
                    jenkins.updateComputerList();
                    jenkins.trimLabels();
                }
            });
            // TODO there is a theoretical race whereby the node instance is updated/removed after lock release
            try {
                persistNode(node);
            } catch (IOException | RuntimeException e) {
                // JENKINS-50599: If persisting the node throws an exception, we need to remove the node from
                // memory before propagating the exception.
                Queue.withLock(new Runnable() {
                    @Override
                    public void run() {
                        nodes.compute(node.getNodeName(), (ignoredNodeName, ignoredNode) -> oldNode);
                        jenkins.updateComputerList();
                        jenkins.trimLabels();
                    }
                });
                throw e;
            }
            NodeListener.fireOnCreated(node);
        }
    }