Class DirectedGraphEdge<TKey, TNodeValue, TEdgeValue>
- Namespace
- LfrlAnvil.Collections
- Assembly
- LfrlAnvil.Collections.dll
Represents a generic IDirectedGraph<TKey, TNodeValue, TEdgeValue> edge.
public sealed class DirectedGraphEdge<TKey, TNodeValue, TEdgeValue> : IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue> where TKey : notnull
Type Parameters
TKey
Graph's key type.
TNodeValue
Graph node's value type.
TEdgeValue
Graph edge's value type.
- Inheritance
-
DirectedGraphEdge<TKey, TNodeValue, TEdgeValue>
- Implements
-
IDirectedGraphEdge<TKey, TNodeValue, TEdgeValue>
- Inherited Members
- Extension Methods
Properties
Direction
public GraphDirection Direction { get; }
Property Value
Source
Source node of this edge.
public DirectedGraphNode<TKey, TNodeValue, TEdgeValue> Source { get; }
Property Value
- DirectedGraphNode<TKey, TNodeValue, TEdgeValue>
Target
Target node of this edge.
public DirectedGraphNode<TKey, TNodeValue, TEdgeValue> Target { get; }
Property Value
- DirectedGraphNode<TKey, TNodeValue, TEdgeValue>
Value
Underlying value.
public TEdgeValue Value { get; set; }
Property Value
- TEdgeValue
Methods
ChangeDirection(GraphDirection)
Changes this edge's Direction.
public void ChangeDirection(GraphDirection direction)
Parameters
direction
GraphDirectionNew direction.
Exceptions
- InvalidOperationException
When this edge has been removed.
- ArgumentException
When
direction
is equal to None.
Remove()
Removes this edge from the associated DirectedGraph<TKey, TNodeValue, TEdgeValue> instance.
public void Remove()
Exceptions
- InvalidOperationException
When this edge has already been removed.
ToString()
Returns a string representation of this DirectedGraphEdge<TKey, TNodeValue, TEdgeValue> instance.
[Pure]
public override string ToString()
Returns
- string
String representation.