public class Module extends CfgVariableContainerNode
NEW_VAR_PREFIX
Constructor and Description |
---|
Module(java.lang.String name)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(CfgModelNode node)
Adds child node.
|
void |
addParent(CfgModelNode node)
Adds parent node.
|
void |
applyBindings(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Applies bindings to module's internals.
|
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.
|
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns node string description in the format of the specified printer.
|
java.util.List<ru.ispras.fortress.expression.NodeVariable> |
getInputs()
Returns all the module variables,
that are of input signal type,
or empty collection, if there are no such.
|
java.util.List<Module> |
getModules()
Returns sub-modules.
|
java.lang.String |
getName()
Returns module name.
|
CfgModelNode |
getOnlyChild()
Returns the only child node.
|
CfgModelNode |
getOnlyParent()
Returns the only parent node.
|
java.util.List<ru.ispras.fortress.expression.NodeVariable> |
getOutputs()
Returns all the module variables,
that are of output signal type,
or empty collection, if there are no such.
|
java.util.Collection<CfgModelNode> |
getParents()
Returns parent nodes.
|
java.util.List<Process> |
getProcesses()
Returns module's processes.
|
CfgNodeType |
getType()
Returns node type.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Returns a set of used variables.
|
boolean |
hasChildren()
Checks rather node has child nodes.
|
boolean |
hasParents()
Checks rather node has parent nodes.
|
void |
instantiate(java.lang.String instanceName,
java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Constructs an instance of this module
|
void |
removeChild(CfgModelNode node)
Removes child node.
|
void |
removeParent(CfgModelNode node)
Removes parent node.
|
void |
removeProcesses()
Remove module's processes.
|
void |
setInstanceName(java.lang.String instanceName)
Sets instance name.
|
addDeclaration, addNewVariable, addVariable, addVariable, addVariableVersion, containsVariable, getBindings, getDeclaration, getDeclarations, getVariable, getVariables, getVariablesMapping, removeDeclaration, setBindings, setVariablesMapping
getId
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo, removeMetaInfo
public Module(java.lang.String name)
name
- module namejava.lang.NullPointerException
- when argument is null
.public void setInstanceName(java.lang.String instanceName)
instanceName
- name of current instancejava.lang.NullPointerException
- when argument is null
.public java.util.List<Process> getProcesses()
public java.util.List<Module> getModules()
public void instantiate(java.lang.String instanceName, java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
instanceName
- instance namebindings
- instance bindingsjava.lang.NullPointerException
- when any of the arguments is null
.public void applyBindings(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
bindings
- "variable name - expression" bindingjava.lang.NullPointerException
- when argument is null
.public java.lang.String getName()
public java.util.List<ru.ispras.fortress.expression.NodeVariable> getInputs()
public java.util.List<ru.ispras.fortress.expression.NodeVariable> getOutputs()
public void removeProcesses()
public CfgModelNode deepcopy()
CfgModelNode
deepcopy
in class CfgModelNode
public void addChild(CfgModelNode node)
addChild
in class CfgModelNode
node
- child nodejava.lang.IllegalArgumentException
- when the specified node
is not of Process
type
and not of Module
type.java.lang.NullPointerException
- when argument is null
.public void addParent(CfgModelNode node)
addParent
in class CfgModelNode
node
- parent nodejava.lang.IllegalArgumentException
- when the specified node
is not of Module
type.java.lang.NullPointerException
- when argument is null
.public void removeChild(CfgModelNode node)
removeChild
in class CfgModelNode
node
- child nodejava.lang.IllegalArgumentException
- when: 1) the specified node
is not of Process
type
and not of Module
type;
2) this object does not contain the specified node as child.java.lang.NullPointerException
- when argument is null
.public void removeParent(CfgModelNode node)
removeParent
in class CfgModelNode
node
- parent nodejava.lang.IllegalArgumentException
- when this object
does not contain the specified node as parent node.java.lang.NullPointerException
- when argument is null
.public java.util.Collection<CfgModelNode> getParents()
CfgModelNode
getParents
in class CfgModelNode
public CfgModelNode getOnlyChild()
CfgModelNode
getOnlyChild
in class CfgModelNode
public java.util.Collection<CfgModelNode> getChildren()
CfgModelNode
getChildren
in class CfgModelNode
public java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
CfgModelNode
getDescription
in class CfgModelNode
printer
- printerpublic CfgNodeType getType()
CfgModelNode
CfgNodeType.NODE
type.getType
in class CfgModelNode
public boolean hasParents()
CfgModelNode
hasParents
in class CfgModelNode
true
if node has at least one parent, false
otherwise.public boolean hasChildren()
CfgModelNode
hasChildren
in class CfgModelNode
true
if node has at least one child,
false
otherwise.public CfgModelNode getOnlyParent()
CfgModelNode
getOnlyParent
in class CfgModelNode
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getUses()
UseDef
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getDefines()
UseDef