Difference between revisions of "XCSG:TernaryConditionalOperator"

From AtlasWiki
Jump to: navigation, search
Line 1: Line 1:
 
The ternary conditional operator selects between two possible values based on a condition.
 
The ternary conditional operator selects between two possible values based on a condition.
  
In an XCSG graph, the operator is represented as two separate entities: the [[TernaryCondition]] (a [[DataFlowCondition]]) and the [[TernarySelection]] (an [[InfixOperator]]). These two nodes are connected by the ConditionalOperator edge.
+
In an XCSG graph, the operator is represented as two separate entities: the value used to decide which value will be returned [[DataFlow (Edge)|flows]] into the [[TernaryCondition]], which is connected by a TernaryConditionalOperator edge to a [[TernarySelection]] node.
 +
 
 +
The TernarySelection's [[leftOperand]] is the value returned if the TernaryCondition evaluates to <code>true</code>, the TernarySelection's [[rightOperand]] is the value returned if the TernaryCondition evaluates to <code>false</code>.
  
 
== Specification ==
 
== Specification ==
 
{{Edge
 
{{Edge
 
| extends = Edge
 
| extends = Edge
| description = Connects a [[TernaryCondition]] to the corresponding [[ConditionalSelection]] operator.
+
| description = Connects a [[TernaryCondition]] to the corresponding [[TernarySelection]] operator.
| connects = TernaryCondition,ConditionalSelection,1,1
+
| connects = TernaryCondition,TernarySelection,1,1
 
}}
 
}}

Revision as of 19:05, 5 May 2014

The ternary conditional operator selects between two possible values based on a condition.

In an XCSG graph, the operator is represented as two separate entities: the value used to decide which value will be returned flows into the TernaryCondition, which is connected by a TernaryConditionalOperator edge to a TernarySelection node.

The TernarySelection's leftOperand is the value returned if the TernaryCondition evaluates to true, the TernarySelection's rightOperand is the value returned if the TernaryCondition evaluates to false.

Specification

Metaclass TernaryConditionalOperator
Extends Edge
Description Connects a TernaryCondition to the corresponding TernarySelection operator.
Specified Connections
Predecessor Multiplicity Successor
TernaryCondition 1 ➞ 1 TernarySelection