TreeComparer<TNode> Class

Definition

Implements a tree differencing algorithm.

generic <typename TNode>
public ref class TreeComparer abstract
public abstract class TreeComparer<TNode>
type TreeComparer<'Node> = class
Public MustInherit Class TreeComparer(Of TNode)

Type Parameters

TNode

Tree node.

Inheritance
TreeComparer<TNode>

Remarks

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

Constructors

TreeComparer<TNode>()

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