Class ConstantNode

Namespace
LogicalOptimizer
Assembly
LogicalOptimizer.Core.dll

Boolean constant (0 or 1). A dedicated node type so that algorithms never have to remember that some "variables" are not really variables.

public sealed class ConstantNode : AstNode
Inheritance
ConstantNode
Inherited Members

Constructors

ConstantNode(bool)

public ConstantNode(bool value)

Parameters

value bool

Fields

False

public static readonly ConstantNode False

Field Value

ConstantNode

True

public static readonly ConstantNode True

Field Value

ConstantNode

Properties

Value

public bool Value { get; }

Property Value

bool

Methods

Clone()

public override AstNode Clone()

Returns

AstNode

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetVariables()

public override HashSet<string> GetVariables()

Returns

HashSet<string>

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.