Table of Contents

Struct DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue>

Namespace
LfrlAnvil.Collections
Assembly
LfrlAnvil.Collections.dll

Represents an information about two IDirectedGraphNode<TKey, TNodeValue, TEdgeValue> instances connected together through the same IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue> instance.

public readonly struct DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue> where TKey : notnull

Type Parameters

TKey

Graph entry's key type.

TNodeValue

Graph node's value type.

TEdgeValue

Graph edge's value type.

Inherited Members

Properties

CanBeReached

Specifies whether or not the traversal from the To node to the From node is valid.

public bool CanBeReached { get; }

Property Value

bool

CanReach

Specifies whether or not the traversal from the From node to the To node is valid.

public bool CanReach { get; }

Property Value

bool

Direction

Direction of the connection between From and To.

public GraphDirection Direction { get; }

Property Value

GraphDirection

Edge

Graph edge that connects From and To.

public IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue> Edge { get; }

Property Value

IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue>

From

Source graph node.

public IDirectedGraphNode<TKey, TNodeValue, TEdgeValue> From { get; }

Property Value

IDirectedGraphNode<TKey, TNodeValue, TEdgeValue>

To

Destination graph node.

public IDirectedGraphNode<TKey, TNodeValue, TEdgeValue> To { get; }

Property Value

IDirectedGraphNode<TKey, TNodeValue, TEdgeValue>

Methods

ForSource(IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue>)

Creates a new DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue> instance with Source node being the From node.

[Pure]
public static DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue> ForSource(IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue> edge)

Parameters

edge IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue>

Source graph edge.

Returns

DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue>

New DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue> instance.

ForTarget(IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue>)

Creates a new DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue> instance with Target node being the From node.

[Pure]
public static DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue> ForTarget(IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue> edge)

Parameters

edge IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue>

Source graph edge.

Returns

DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue>

New DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue> instance.

ToString()

Returns a string representation of this DirectedGraphEdgeInfo<TKey, TNodeValue, TEdgeValue> instance.

[Pure]
public override string ToString()

Returns

string

String representation.