public class Merge extends CfgNode
It is a reversed version of switch node. This node has only one child node and more than one parent node. Every time no more than one parent node is active.
childNode, parentNode
Constructor and Description |
---|
Merge()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addParent(CfgModelNode node)
Adds parent node.
|
CfgModelNode |
deepCopy()
Returns a copy of this node.
|
java.util.Collection<CfgModelNode> |
getChildren()
Return child nodes.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Returns a set of defined variables.
|
CfgModelNode |
getOnlyChild()
Returns the only child node.
|
CfgModelNode |
getOnlyParent()
Returns the only parent node.
|
java.util.Collection<CfgModelNode> |
getParents()
Returns parent nodes.
|
CfgNodeType |
getType()
Returns node type.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Returns a set of used variables.
|
boolean |
hasOnlyChild()
Checks rather node has exactly one child node.
|
boolean |
hasOnlyParent()
Checks rather node has exactly one parent node.
|
boolean |
hasParents()
Checks rather node has parent nodes.
|
void |
removeParent(CfgModelNode node)
Removes parent node.
|
addChild, equals, getDescription, getId, hasChildren, hashCode, removeChild
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
public CfgModelNode deepCopy()
CfgModelNode
The copy does not keep the same links to parent or child nodes as this has.
public CfgNodeType getType()
CfgModelNode
By default, node has CfgNodeType.UNKNOWN
type.
public boolean hasParents()
CfgModelNode
hasParents
in interface CfgModelNode
hasParents
in class CfgNode
true
if node has at least one parent, false
otherwise.public boolean hasOnlyParent()
CfgModelNode
true
if node has exactly one parent at the moment, false
otherwise.public boolean hasOnlyChild()
CfgModelNode
true
if node has exactly one child at the moment, false
otherwise.public CfgModelNode getOnlyParent()
CfgModelNode
public void addParent(CfgModelNode node)
addParent
in interface CfgModelNode
addParent
in class CfgNode
node
- parent nodejava.lang.IllegalArgumentException
- when either argument is null
or the specified node is not of CfgNode
type.public void removeParent(CfgModelNode node)
removeParent
in interface CfgModelNode
removeParent
in class CfgNode
node
- parent nodejava.lang.IllegalArgumentException
- in the following situations: (1) argument is null
;
(2) the specified node is not of CfgNode
type.java.lang.IllegalStateException
- when the object does not contain the specified parent node.public java.util.Collection<CfgModelNode> getParents()
CfgModelNode
getParents
in interface CfgModelNode
getParents
in class CfgNode
public CfgModelNode getOnlyChild()
CfgModelNode
public java.util.Collection<CfgModelNode> getChildren()
CfgModelNode
getChildren
in interface CfgModelNode
getChildren
in class CfgNode
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getUses()
UseDef
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getDefines()
UseDef