TreeComparer<TNode> Class

Definition

Implements a tree differencing algorithm.

C#
public abstract class TreeComparer<TNode>

Type Parameters

TNode

Tree node.

Inheritance
TreeComparer<TNode>

Remarks

Subclasses define relationships among tree nodes, and parameters to the differencing algorithm.

Constructors

Properties

LabelCount

The number of distinct labels used in the tree.

Methods

ComputeEditScript(TNode, TNode)

Returns an edit script that transforms oldRoot to newRoot.

ComputeMatch(TNode, TNode, IEnumerable<KeyValuePair<TNode,TNode>>)

Returns a match map of oldRoot descendants to newRoot descendants.

GetChildren(TNode)

May return null if the node is a leaf.

GetDescendants(TNode)

Enumerates all descendant nodes of the given node in depth-first prefix order.

GetDistance(TNode, TNode)

Calculates the distance [0..1] of two nodes.

GetLabel(TNode)

Returns an integer label corresponding to the given node.

GetSpan(TNode)

Returns the position of the node.

TiedToAncestor(Int32)

Returns N > 0 if the node with specified label can't change its N-th ancestor node, zero otherwise.

TreesEqual(TNode, TNode)

Return true if specified nodes belong to the same tree.

TryGetParent(TNode, TNode)

Returns a parent for the specified node.

ValuesEqual(TNode, TNode)

Returns true if the specified nodes have equal values.

Applies to

Producto Versiones
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0