Inserts a node into this trie

@param node  node to insert
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);
        }
    }
1019390
public void addNode(NodeT node) {
        node.setOwner(this);
        nodeTable.put(node.key(), node);
    }
409097
protected void layout(TreeNode node) {
    if (node != null) {
      TreeNode child = node.child;

      while (child != null) {
        layout(child);
        child = child.next;
      }

      if (node.child != null) {
        attachParent(node, join(node));
      } else {
        layoutLeaf(node);
      }
    }
  }
1152440
public static void addAstNode(LexLocation location, INode node)
	{
		synchronized (locationToAstNode)
		{
			locationToAstNode.put(location, node);
		}
	}
1349101
public Node insertBefore(Node newChild, Node refChild) throws DOMException
  {
  	if(null == refChild)
  	{
  		appendChild(newChild);
  		return newChild;
  	}
  	
  	if(newChild == refChild)
  	{
  		// hmm...
  		return newChild;
  	}

    Node node = m_firstChild; 
    Node prev = null;  
    boolean foundit = false;
    
    while (null != node)
    {
    	// If the newChild is already in the tree, it is first removed.
    	if(newChild == node)
    	{
    		if(null != prev)
    			((ElemTemplateElement)prev).m_nextSibling = 
    				(ElemTemplateElement)node.getNextSibling();
    		else
    			m_firstChild = (ElemTemplateElement)node.getNextSibling();
    		node = node.getNextSibling();
    		continue; // prev remains the same.
    	}
    	if(refChild == node)
    	{
    		if(null != prev)
    		{
    			((ElemTemplateElement)prev).m_nextSibling = (ElemTemplateElement)newChild;
    		}
    		else
    		{
    			m_firstChild = (ElemTemplateElement)newChild;
    		}
    		((ElemTemplateElement)newChild).m_nextSibling = (ElemTemplateElement)refChild;
    		((ElemTemplateElement)newChild).setParentElem(this);
    		prev = newChild;
    		node = node.getNextSibling();
    		foundit = true;
    		continue;
    	}
    	prev = node;
    	node = node.getNextSibling();
    }
    
    if(!foundit)
    	throw new DOMException(DOMException.NOT_FOUND_ERR, 
    		"refChild was not found in insertBefore method!");
    else
    	return newChild;
  }
534071
protected void startNode(int node) throws org.xml.sax.SAXException
  {

    XPathContext xcntxt = m_transformer.getXPathContext();
    try
    {
      
      if (DTM.ELEMENT_NODE == m_dtm.getNodeType(node))
      {
        xcntxt.pushCurrentNode(node);                   
                                        
        if(m_startNode != node)
        {
          super.startNode(node);
        }
        else
        {
          String elemName = m_dtm.getNodeName(node);
          String localName = m_dtm.getLocalName(node);
          String namespace = m_dtm.getNamespaceURI(node);
                                        
          //xcntxt.pushCurrentNode(node);       
          // SAX-like call to allow adding attributes afterwards
          m_handler.startElement(namespace, localName, elemName);
          boolean hasNSDecls = false;
          DTM dtm = m_dtm;
          for (int ns = dtm.getFirstNamespaceNode(node, true); 
               DTM.NULL != ns; ns = dtm.getNextNamespaceNode(node, ns, true))
          {
            SerializerUtils.ensureNamespaceDeclDeclared(m_handler,dtm, ns);
          }
                                                
                                                
          for (int attr = dtm.getFirstAttribute(node); 
               DTM.NULL != attr; attr = dtm.getNextAttribute(attr))
          {
            SerializerUtils.addAttribute(m_handler, attr);
          }
        }
                                
      }
      else
      {
        xcntxt.pushCurrentNode(node);
        super.startNode(node);
        xcntxt.popCurrentNode();
      }
    }
    catch(javax.xml.transform.TransformerException te)
    {
      throw new org.xml.sax.SAXException(te);
    }
  }
1051578
public Tree<T> add(Tree<T> node) {
    node.removeFromParent();
    node.parent = this;
    children.add(node);
    return node;
  }
912871
public void add(final ObjectSinkNode node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            this.lastNode.setNextObjectSinkNode( node );
            node.setPreviousObjectSinkNode( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }
774396
@Override
    public void addNodeAttributes(Element node) {
        node.setAttribute("ID", this.getId());
        node.setAttribute("name", this.getName());
        node.setAttribute("unremovable", String.valueOf(this.isUnremovable()));
        node.setAttribute("immutable", String.valueOf(this.isImmutable()));
        node.setAttribute("hidden", String.valueOf(this.isHidden()));

        if (!this.isDeleteAllowed())
            node.setAttributeNS(Constants.NS_URI, Constants.ATT_DELETE_ALLOWED, "false");
        if (!this.isMoveAllowed())
            node.setAttributeNS(Constants.NS_URI, Constants.ATT_MOVE_ALLOWED, "false");
        if (!this.isEditAllowed())
            node.setAttributeNS(Constants.NS_URI, Constants.ATT_EDIT_ALLOWED, "false");
        if (!this.isAddChildAllowed())
            node.setAttributeNS(Constants.NS_URI, Constants.ATT_ADD_CHILD_ALLOWED, "false");
        if (this.getPrecedence() != 0.0)
            node.setAttributeNS(
                    Constants.NS_URI,
                    Constants.ATT_PRECEDENCE,
                    Double.toString(this.getPrecedence()));
    }
1307360
public boolean add(AbstractRslNode node) {
        if (_specifications == null) _specifications = new LinkedList();
        return _specifications.add(node);
    }
679336
public void addNode(HtmlMatcherGraphNode node) {
    checkNotNull(node);
    if (graphCursor.isPresent()) {
      graphCursor.get().linkActiveEdgeToNode(node);
    }
    setGraphCursorNode(node);
  }
884581
private void processNode(Node node) throws IOException {
		for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor.getNext()) {
			int lineno = cursor.getLineno()-1;	// adjust for rhino line numbers being 1 based
			int charno = cursor.getCharno();
			if (lineno > currentLine || lineno == currentLine && charno > currentChar) {
				currentLine = lineno;
				currentChar = charno;
			}
			FilePosition endPosition = getEndPosition(cursor);
			sgen.addMapping(name, null,
					new FilePosition(currentLine, currentChar),
					new FilePosition(currentLine, currentChar),
					endPosition);
			if (cursor.hasChildren()) {
				processNode(cursor);
			}
		}
	}
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();
        }
    }
592734
public static void mergeNodeChildren(TreeNode node) {
        DefaultMutableTreeNode masterNode = (DefaultMutableTreeNode) node;

        // The rules are there are no rules. Nothing else needs to be done
        // except for merging through the children
        for (int i = 0; i < masterNode.getChildCount(); i++) {
            DefaultMutableTreeNode child = (DefaultMutableTreeNode) masterNode.getChildAt(i);

            if (!child.isLeaf()) {
                MergeHelpUtilities.mergeNodeChildren(DEFAULT_MERGE_TYPE, child);
            }
        }
    }
1200662
private void addAtConstructor(Node node) {
    JSDocInfoBuilder builder = JSDocInfoBuilder.maybeCopyFrom(node.getJSDocInfo());
    builder.recordConstructor();
    node.setJSDocInfo(builder.build());
  }
265629
public void insertNode(Node n, int pos)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

    insertElementAt(n, pos);
  }
386441
public void insertNodeAt(Node insert, int index, double split) {
        addChild(insert, index, split);
        notifyStateChange();
    }