public class Module extends VariableContainer implements CfgModelNode
NEW_VAR_PREFIX
Constructor and Description |
---|
Module(java.lang.String name)
Constructs object with the specified name.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(CfgModelNode node)
Adds child node.
|
void |
addParent(CfgModelNode node)
Adds parent node.
|
CfgModelNode |
deepCopy()
Returns a copy of this node.
|
boolean |
equals(java.lang.Object obj) |
java.util.Collection<CfgModelNode> |
getChildren()
Return child nodes.
|
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns node string description in the format of the specified printer.
|
java.lang.String |
getId()
Returns unique node identifier in string form.
|
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> |
getInputs()
Returns all the 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 name.
|
CfgModelNode |
getOnlyChild()
Returns the only child node.
|
CfgModelNode |
getOnlyParent()
Returns the only parent node.
|
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> |
getOutputs()
Returns all 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.Collection<Process> |
getProcesses()
Returns processes.
|
CfgNodeType |
getType()
Returns node type.
|
boolean |
hasChildren()
Checks rather node has child nodes.
|
int |
hashCode() |
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 |
instantiate(java.lang.String instanceName,
java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Instantiates this object with the specified name and bindings.
|
void |
removeChild(CfgModelNode node)
Removes child node.
|
void |
removeParent(CfgModelNode node)
Removes parent node.
|
void |
removeProcesses()
Remove internal processes.
|
void |
setInstanceName(java.lang.String instanceName)
Sets instance name.
|
containsInput, containsOutput, containsRegister, containsVariable, containsVariable, declareNewVariable, declareVariable, declareVariable, declareVariable, declareVariables, declareVariableVersion, getBindings, getDataType, getDeclaration, getDeclarations, getInitialValue, getInputNames, getInvariant, getOutputNames, getRegisterNames, getVariable, getVariableNames, getVariables, getVariablesMapping, removeDeclaration, setBindings, setVariablesMapping
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
public Module(java.lang.String name)
name
- module namejava.lang.IllegalArgumentException
- when argument is null
.public void setInstanceName(java.lang.String instanceName)
instanceName
- name of current instancejava.lang.IllegalArgumentException
- when argument is null
.public java.util.Collection<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.IllegalArgumentException
- when any of the arguments is null
.public java.lang.String getName()
public java.util.Collection<ru.ispras.fortress.expression.NodeVariable> getInputs()
public java.util.Collection<ru.ispras.fortress.expression.NodeVariable> getOutputs()
public void removeProcesses()
public CfgModelNode deepCopy()
CfgModelNode
The copy does not keep the same links to parent or child nodes as this has.
deepCopy
in interface CfgModelNode
public java.lang.String getId()
CfgModelNode
getId
in interface CfgModelNode
public void addChild(CfgModelNode node)
addChild
in interface CfgModelNode
node
- child nodejava.lang.IllegalArgumentException
- in the following situations:
(1) when the specified node is neither of
Process
nor of Module
type;
(2) when argument is null
.public void addParent(CfgModelNode node)
addParent
in interface CfgModelNode
node
- parent nodejava.lang.IllegalArgumentException
- when argument is either null
or not of Module
type.public void removeChild(CfgModelNode node)
removeChild
in interface CfgModelNode
node
- child nodejava.lang.IllegalArgumentException
- in the following situations: (1) when the specified node
is not of Process
type
and not of Module
type;
(2) this object does not contain the specified node as child;
(3) argument is null
.public void removeParent(CfgModelNode node)
removeParent
in interface CfgModelNode
node
- parent nodejava.lang.IllegalArgumentException
- when either this object
does not contain the specified node as parent node
or argument is null
.public java.util.Collection<CfgModelNode> getParents()
CfgModelNode
getParents
in interface CfgModelNode
public CfgModelNode getOnlyChild()
CfgModelNode
getOnlyChild
in interface CfgModelNode
public java.util.Collection<CfgModelNode> getChildren()
CfgModelNode
getChildren
in interface CfgModelNode
public java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
CfgModelNode
getDescription
in interface CfgModelNode
printer
- printerpublic CfgNodeType getType()
CfgModelNode
By default, node has CfgNodeType.UNKNOWN
type.
getType
in interface CfgModelNode
public boolean hasParents()
CfgModelNode
hasParents
in interface CfgModelNode
true
if node has at least one parent, false
otherwise.public boolean hasOnlyParent()
CfgModelNode
hasOnlyParent
in interface CfgModelNode
true
if node has exactly one parent at the moment, false
otherwise.public boolean hasChildren()
CfgModelNode
hasChildren
in interface CfgModelNode
true
if node has at least one child, false
otherwise.public boolean hasOnlyChild()
CfgModelNode
hasOnlyChild
in interface CfgModelNode
true
if node has exactly one child at the moment, false
otherwise.public CfgModelNode getOnlyParent()
CfgModelNode
getOnlyParent
in interface CfgModelNode
public boolean equals(java.lang.Object obj)
equals
in class VariableContainer
public int hashCode()
hashCode
in class VariableContainer