Class TernaryOperatorNode
A ternary operator.
Inherited Members
Namespace: SpiceSharpBehavioral.Parsers.Nodes
Assembly: SpiceSharpBehavioral.dll
Syntax
public class TernaryOperatorNode : Node
Constructors
TernaryOperatorNode(NodeTypes, Node, Node, Node)
Initializes a new instance of the TernaryOperatorNode class.
Declaration
protected TernaryOperatorNode(NodeTypes type, Node condition, Node ifTrue, Node ifFalse)
Parameters
Type | Name | Description |
---|---|---|
NodeTypes | type | The type. |
Node | condition | The condition. |
Node | ifTrue | If true. |
Node | ifFalse | If false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
Properties
Condition
Gets the condition.
Declaration
public Node Condition { get; }
Property Value
Type | Description |
---|---|
Node | The condition. |
IfFalse
Gets if false.
Declaration
public Node IfFalse { get; }
Property Value
Type | Description |
---|---|
Node | If false. |
IfTrue
Gets if true.
Declaration
public Node IfTrue { get; }
Property Value
Type | Description |
---|---|
Node | If true. |
Properties
Gets the properties.
Declaration
public override NodeProperties Properties { get; }
Property Value
Type | Description |
---|---|
NodeProperties | The properties. |
Overrides
Methods
Conditional(Node, Node, Node)
Creates a conditional value.
Declaration
public static TernaryOperatorNode Conditional(Node condition, Node ifTrue, Node ifFalse)
Parameters
Type | Name | Description |
---|---|---|
Node | condition | The condition that decides what the result should be. |
Node | ifTrue | The value if the condition is true. |
Node | ifFalse | The value if the condition is false. |
Returns
Type | Description |
---|---|
TernaryOperatorNode | The node representing the conditional value. |
Equals(Object)
Determines whether the specified System.Object, is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
ToString()
Converts to string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |