public class Source extends CfgNode
Source node has only one parent node that does not belong to control flow graph and only one child node.
childNode, parentNode
Constructor and Description |
---|
Source()
Default constructor.
|
Source(CfgModelNode parent)
Constructs object with the specified parent node.
|
Modifier and Type | Method and Description |
---|---|
void |
addParent(CfgModelNode node)
Adds parent node.
|
CfgModelNode |
deepCopy()
Returns a copy of this node.
|
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, getChildren, getDescription, getId, hasChildren, hashCode, removeChild
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
public Source()
public Source(CfgModelNode parent)
parent
- parent nodejava.lang.IllegalArgumentException
- when argument is null
.public CfgModelNode deepCopy()
CfgModelNode
The copy does not keep the same links to parent or child nodes as this has.
public void addParent(CfgModelNode node)
addParent
in interface CfgModelNode
addParent
in class CfgNode
node
- parent nodejava.lang.IllegalArgumentException
- when argument is either null
or of CfgNode
type.java.lang.IllegalStateException
- when parent node is not equal to null
already.public void removeParent(CfgModelNode node)
removeParent
in interface CfgModelNode
removeParent
in class CfgNode
node
- parent nodejava.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalStateException
- when the internal parent node
is not equal to the specified node.public java.util.Collection<CfgModelNode> getParents()
CfgModelNode
getParents
in interface CfgModelNode
getParents
in class CfgNode
public CfgModelNode getOnlyChild()
CfgModelNode
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 java.util.Set<ru.ispras.fortress.expression.NodeVariable> getUses()
UseDef
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getDefines()
UseDef