Table of Contents

Method SetEdge

Namespace
Bonsai.Dag
Assembly
Bonsai.Core.dll

SetEdge(Node<TNodeValue, TEdgeLabel>, int, Node<TNodeValue, TEdgeLabel>, TEdgeLabel)

Creates and replaces a labeled outgoing edge of the source node at the specified index.

public Edge<TNodeValue, TEdgeLabel> SetEdge(Node<TNodeValue, TEdgeLabel> from, int edgeIndex, Node<TNodeValue, TEdgeLabel> to, TEdgeLabel label)

Parameters

from Node<TNodeValue, TEdgeLabel>

The node that is the source of the edge.

edgeIndex int

The zero-based index of the edge to replace on the successor list of the from node.

to Node<TNodeValue, TEdgeLabel>

The node that is the target of the edge.

label TEdgeLabel

The value of the edge label.

Returns

Edge<TNodeValue, TEdgeLabel>

The created edge.

SetEdge(Node<TNodeValue, TEdgeLabel>, int, Edge<TNodeValue, TEdgeLabel>)

Replaces a labeled outgoing edge of a source node at the specified index.

public void SetEdge(Node<TNodeValue, TEdgeLabel> from, int edgeIndex, Edge<TNodeValue, TEdgeLabel> edge)

Parameters

from Node<TNodeValue, TEdgeLabel>

The node that is the source of the edge.

edgeIndex int

The zero-based index of the edge to replace on the successor list of the from node.

edge Edge<TNodeValue, TEdgeLabel>

The labeled outgoing edge that is to be set at the specified index on the successor list of the from node.