Table of Contents

Class StateMachineNodeExtensions

Namespace
LfrlAnvil.Computable.Automata.Extensions
Assembly
LfrlAnvil.Computable.Automata.dll

Contains IStateMachineNode<TState, TInput, TResult> extension methods.

public static class StateMachineNodeExtensions
Inheritance
StateMachineNodeExtensions
Inherited Members

Methods

CanTransition<TState, TInput, TResult>(IStateMachineNode<TState, TInput, TResult>)

Checks whether or not the provided node contains any transitions.

[Pure]
public static bool CanTransition<TState, TInput, TResult>(this IStateMachineNode<TState, TInput, TResult> node) where TState : notnull where TInput : notnull

Parameters

node IStateMachineNode<TState, TInput, TResult>

Node to check.

Returns

bool

true when node contains at least one transition, otherwise false.

Type Parameters

TState

State type.

TInput

Input type.

TResult

Result type.

CanTransition<TState, TInput, TResult>(IStateMachineNode<TState, TInput, TResult>, TInput)

Checks whether or not the provided node contains transition with the provided identifier.

[Pure]
public static bool CanTransition<TState, TInput, TResult>(this IStateMachineNode<TState, TInput, TResult> node, TInput input) where TState : notnull where TInput : notnull

Parameters

node IStateMachineNode<TState, TInput, TResult>

Node to check.

input TInput

Transition identifier to check.

Returns

bool

true when node contains the provided transition, otherwise false.

Type Parameters

TState

State type.

TInput

Input type.

TResult

Result type.

IsAccept<TState, TInput, TResult>(IStateMachineNode<TState, TInput, TResult>)

Checks whether or not the provided node is of Accept type.

[Pure]
public static bool IsAccept<TState, TInput, TResult>(this IStateMachineNode<TState, TInput, TResult> node) where TState : notnull where TInput : notnull

Parameters

node IStateMachineNode<TState, TInput, TResult>

Node to check.

Returns

bool

true when node is an Accept node, otherwise false.

Type Parameters

TState

State type.

TInput

Input type.

TResult

Result type.

IsDead<TState, TInput, TResult>(IStateMachineNode<TState, TInput, TResult>)

Checks whether or not the provided node is of Dead type.

[Pure]
public static bool IsDead<TState, TInput, TResult>(this IStateMachineNode<TState, TInput, TResult> node) where TState : notnull where TInput : notnull

Parameters

node IStateMachineNode<TState, TInput, TResult>

Node to check.

Returns

bool

true when node is an Dead node, otherwise false.

Type Parameters

TState

State type.

TInput

Input type.

TResult

Result type.

IsInitial<TState, TInput, TResult>(IStateMachineNode<TState, TInput, TResult>)

Checks whether or not the provided node is of Initial type.

[Pure]
public static bool IsInitial<TState, TInput, TResult>(this IStateMachineNode<TState, TInput, TResult> node) where TState : notnull where TInput : notnull

Parameters

node IStateMachineNode<TState, TInput, TResult>

Node to check.

Returns

bool

true when node is an Initial node, otherwise false.

Type Parameters

TState

State type.

TInput

Input type.

TResult

Result type.