public class Switch extends CfgNode
true
, but it can be executed only when the specified event
Event
happens.childNode, parentNode
Constructor and Description |
---|
Switch(Event event)
Constructs an object with the specified event
and trivial expression.
|
Switch(ru.ispras.fortress.expression.Node condition)
Constructs an object with the specified expression.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(CfgModelNode node)
Adds the specified child node.
|
CfgModelNode |
deepcopy()
Returns a copy of this node.
|
java.util.Collection<CfgModelNode> |
getChildren()
Return child nodes.
|
ru.ispras.fortress.expression.Node |
getCondition()
Returns condition expression.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Throws an exception.
|
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns a string description in the format of the specified printer.
|
Event |
getEvent()
Returns event.
|
CfgModelNode |
getOnlyChild()
Returns the only child node.
|
CfgModelNode |
getOnlyParent()
Returns the only parent node.
|
CfgNodeType |
getType()
Returns node type.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Throws an exception.
|
boolean |
hasChildren()
Checks rather node has child nodes.
|
void |
removeChild(CfgModelNode node)
Removes child node.
|
void |
setExpression(ru.ispras.fortress.expression.Node expr)
Sets new expression.
|
addParent, getParents, hasParents, removeParent
getId
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo, removeMetaInfo
public Switch(ru.ispras.fortress.expression.Node condition)
condition
- switch expressionjava.lang.NullPointerException
- when argument is null
.public Switch(Event event)
event
- eventjava.lang.NullPointerException
- when argument is null
.public ru.ispras.fortress.expression.Node getCondition()
public void setExpression(ru.ispras.fortress.expression.Node expr)
expr
- expressionjava.lang.NullPointerException
- when argument is null
.public Event getEvent()
public CfgModelNode deepcopy()
CfgModelNode
deepcopy
in class CfgModelNode
public java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
getDescription
in class CfgNode
printer
- printer that provides an output string formatjava.lang.NullPointerException
- when argument is null
.public CfgNodeType getType()
CfgModelNode
CfgNodeType.NODE
type.getType
in class CfgModelNode
public boolean hasChildren()
CfgModelNode
hasChildren
in class CfgNode
true
if node has at least one child,
false
otherwise.public CfgModelNode getOnlyParent()
CfgModelNode
getOnlyParent
in class CfgModelNode
public CfgModelNode getOnlyChild()
CfgModelNode
getOnlyChild
in class CfgModelNode
public void addChild(CfgModelNode node)
public void removeChild(CfgModelNode node)
removeChild
in class CfgNode
node
- child nodejava.lang.IllegalArgumentException
- when argument
is not of Case
type.public java.util.Collection<CfgModelNode> getChildren()
CfgModelNode
getChildren
in class CfgNode
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getUses()
CfgNode
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getDefines()
CfgNode
getDefines
in interface UseDef
getDefines
in class CfgNode
null