Adjusts the node count of this node and all parent nodes. Called when nodes are being added/removed from the
tree.

@param delta the change in the node count.
494491
private void adjustNodeCount(final int delta) {
		for (TableTreeNode parent = this; parent != null; parent = (TableTreeNode) parent.
				getParent()) {
			parent.nodeCount += delta;
		}
	}
556513
public void reset() {
		Enumeration<TreeNode> children = root.children();
		while (children.hasMoreElements()) {
			removeNodeFromParent((MutableTreeNode) children.nextElement());
			children = root.children();
		}
	}
153052
def add_adjust(self, data, prehashed=False):
        
        subtrees = self._get_whole_subtrees()
        new_node = Node(data, prehashed=prehashed)
        self.leaves.append(new_node)
        for node in reversed(subtrees):
            new_parent = Node(node.val + new_node.val)
            node.p, new_node.p = new_parent, new_parent
            new_parent.l, new_parent.r = node, new_node
            node.sib, new_node.sib = new_node, node
            node.side, new_node.side = 'L', 'R'
            new_node = new_node.p
        self.root = new_node
338410
public void setNodes(java.util.Collection<Node> nodes) {
        if (nodes == null) {
            this.nodes = null;
            return;
        }

        this.nodes = new java.util.ArrayList<Node>(nodes);
    }
666938
@SuppressWarnings("WeakerAccess")
    public void update(int node, double centroid, int count, List<Double> data, boolean forceInPlace) {
        if (centroid == centroids[node]||forceInPlace) {
            // we prefer to update in place so repeated values don't shuffle around and for merging
            centroids[node] = centroid;
            counts[node] = count;
            if (datas != null) {
                datas[node] = data;
            }
        } else {
            // have to do full scale update
            this.centroid = centroid;
            this.count = count;
            this.data = data;
            tree.update(node);
        }
    }
1355088
public void update(int delta) {
		emitter.updateParticle(this, delta);
		life -= delta;
		
		if (life > 0) {
			x += delta * velx;
			y += delta * vely;
		} else {
			engine.release(this);
		}
	}
397975
public void add(T item, long delta) {
        MutableLong entry = map.get(item);
        if (entry == null) {
            entry = MutableLong.valueOf(delta);
            map.put(item, entry);
        } else {
            entry.value += delta;
        }
        total += delta;
    }
826132
@Override
    public void updateReport(AllTablesReportDelta delta) {
        checkNotNull(delta, "delta");

        updateMetadata(delta);

        if (delta.getTable().isPresent()) {
            updateTableData(delta, delta.getTable().get());
        }
    }
130196
private void updateMemberReferenceCount(Node node) {
		switch (node.getNodeType()) {
			case AND:
			case IN:
			case OR:
				RuleExpression expr = node.cast();
				updateMemberReferenceCount(expr.getLeft());
				updateMemberReferenceCount(expr.getRight());
				break;

			case VARIABLE:
				break;

			case MEMBER:
				Member member = node.cast();
				member.incrReferenceCount();
				break;
		}
	}
819802
public void addNode(N node)
    {
        if(!nodes.containsKey(node))
            nodes.put(node, new Pair<HashSet<N>, HashSet<N>>(new HashSet<N>(), new HashSet<N>()));
    }
254028
protected final void setParentNode(final DiffNode parentNode)
	{
		if (this.parentNode != null && this.parentNode != parentNode)
		{
			throw new IllegalStateException("The parent of a node cannot be changed, once it's set.");
		}
		this.parentNode = parentNode;
	}
162831
function(delta){
      events.childNodesModified.call(this, delta);

      var array;
      if (array = delta.inserted)
      {
        for (var i = 0, child; child = array[i++];)
        {
          child.groupId_ = child.delegate ? child.delegate.basisObjectId : child.data.id;
          this.map_[child.groupId_] = child;
        }

        if (this.dataSource && this.nullGroup.first)
        {
          var parentNode = this.owner;
          var nodes = arrayFrom(this.nullGroup.nodes); // basis.array.from, because nullGroup.nodes may be transformed
          for (var i = nodes.length; i-- > 0;)
            parentNode.insertBefore(nodes[i], nodes[i].nextSibling);
        }
      }
    }
734691
public void insertParentBefore(Node node) throws ChildNodeException {
    if (node != null) {
      if (hasParent()) {
        getParentNode().addChild(node);
        getParentNode().removeChild(this);
      }
      node.addChild(this);
    }
  }
4875
private static int countNodes(TreeModel treeModel, Object node)
    {
        int sum = 1;
        int n = treeModel.getChildCount(node);
        for (int i=0; i<n; i++)
        {
            sum += countNodes(treeModel, treeModel.getChild(node, i));
        }
        return sum;
    }
891338
private void init() {
        // Add this node to parents children
        if (null != parent) { parent.getChildren().add(this); }

        children.addListener((ListChangeListener<TreeNode>) c -> {
            while (c.next()) {
                if (c.wasRemoved()) { c.getRemoved().forEach(removedItem -> removedItem.removeAllTreeNodeEventListeners()); }
            }
            getTreeRoot().fireTreeNodeEvent(CHILDREN_CHANGED);
        });
    }
1191353
private void addSubtreeToCheckingStateTracking(DefaultMutableTreeNode node) {
        TreeNode[] path = node.getPath();   
        TreePath tp = new TreePath(path);
        CheckedNode cn = new CheckedNode(false, node.getChildCount() > 0, false);
        nodesCheckingState.put(tp, cn);
        for (int i = 0 ; i < node.getChildCount() ; i++) {              
            addSubtreeToCheckingStateTracking((DefaultMutableTreeNode) tp.pathByAddingChild(node.getChildAt(i)).getLastPathComponent());
        }
    }
778823
public void setDelta(double delta)
    {
        if(delta <= 0 || delta >= 1 || Double.isNaN(delta))
            throw new IllegalArgumentException("delta must be in (0,1), not " + delta);
        this.delta = delta;
    }