public class Case extends CfgNode
childNode, parentNode
Constructor and Description |
---|
Case()
The default constructor.
|
Case(ru.ispras.fortress.expression.NodeValue value)
Constructs node with the specified possible value.
|
Case(java.util.Set<ru.ispras.fortress.expression.NodeValue> values)
Constructs node with the specified possible values.
|
Case(java.util.Set<ru.ispras.fortress.expression.NodeValue> values,
boolean isDefault)
Constructs node with the specified values and default flag.
|
Modifier and Type | Method and Description |
---|---|
void |
addParent(CfgModelNode node)
Adds parent node.
|
void |
addValue(ru.ispras.fortress.expression.NodeValue value)
Adds one more possible value.
|
CfgModelNode |
deepcopy()
Returns a copy of this node.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Throws an exception.
|
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns node string description in the format of the specified printer.
|
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()
Throws an exception.
|
java.util.Set<ru.ispras.fortress.expression.NodeValue> |
getValues()
Returns node values.
|
boolean |
hasParents()
Checks rather node has parent nodes.
|
boolean |
isDefault()
Checks rather case node is default.
|
void |
removeParent(CfgModelNode node)
Removes parent node.
|
void |
setDefault()
Make node default.
|
addChild, getChildren, hasChildren, removeChild
getId
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo, removeMetaInfo
public Case()
public Case(ru.ispras.fortress.expression.NodeValue value)
value
- valuejava.lang.NullPointerException
- when argument is null
.public Case(java.util.Set<ru.ispras.fortress.expression.NodeValue> values)
values
- valuespublic Case(java.util.Set<ru.ispras.fortress.expression.NodeValue> values, boolean isDefault)
false
.
Otherwise the default flag must be set to true
.values
- valuesisDefault
- default flagjava.lang.NullPointerException
- when values argument is null
.public boolean isDefault()
true
if node is default,
false
otherwisepublic void setDefault()
java.lang.IllegalStateException
- method is called for object
with non-empty internal collection of values.public void addValue(ru.ispras.fortress.expression.NodeValue value)
value
- possible value for thisjava.lang.NullPointerException
- when argument is null
.java.lang.IllegalStateException
- when the object is default.public java.util.Set<ru.ispras.fortress.expression.NodeValue> getValues()
public CfgModelNode deepcopy()
CfgModelNode
deepcopy
in class CfgModelNode
public java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
CfgModelNode
getDescription
in class CfgNode
printer
- printerpublic CfgNodeType getType()
CfgModelNode
CfgNodeType.NODE
type.getType
in class CfgModelNode
public void addParent(CfgModelNode node)
addParent
in class CfgNode
node
- parent nodejava.lang.NullPointerException
- when argument is null
.java.lang.IllegalStateException
- when this object already
has non-null parent node.java.lang.IllegalArgumentException
- when the specified node
is not of Switch
type.public void removeParent(CfgModelNode node)
removeParent
in class CfgNode
node
- parent nodejava.lang.NullPointerException
- when argument is null
.java.lang.IllegalArgumentException
- when there is no
such parent node in this object.public boolean hasParents()
CfgModelNode
hasParents
in class CfgNode
true
if node has at least one parent, false
otherwise.public CfgModelNode getOnlyParent()
CfgModelNode
getOnlyParent
in class CfgModelNode
public java.util.Collection<CfgModelNode> getParents()
CfgModelNode
getParents
in class CfgNode
public CfgModelNode getOnlyChild()
CfgModelNode
getOnlyChild
in class CfgModelNode
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