public class CfgCaseStatement extends CfgStatement
Constructor and Description |
---|
CfgCaseStatement(boolean defaultNode)
Constructs case statement of the specified default type.
|
CfgCaseStatement(java.util.Collection<ru.ispras.fortress.expression.NodeValue> values)
Constructs case statement with the specified values.
|
CfgCaseStatement(ru.ispras.fortress.expression.NodeValue value)
Constructs case statement with the specified value.
|
Modifier and Type | Method and Description |
---|---|
void |
add(CfgStatement statement)
Adds the specified statement as child to this object.
|
void |
add(ru.ispras.fortress.expression.NodeValue value)
Adds value to this case statement object.
|
void |
addAll(java.util.List<CfgStatement> list)
Adds all the statements from the specified list as children.
|
CfgStatement |
deepCopy()
Returns a copy of this statement and all it's sub-statements.
|
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns a string description in the format of the specified printer.
|
CfgStatementType |
getType()
Returns statement type.
|
java.util.Set<ru.ispras.fortress.expression.NodeValue> |
getValues()
Returns case statement values.
|
boolean |
isDefault()
Returns case statement default type.
|
void |
remove(CfgStatement statement)
Removes the specified statement from children.
|
void |
remove(ru.ispras.fortress.expression.NodeValue value)
Removes the specified value from this case statement.
|
void |
removeParent(CfgStatement parent)
Removes link with the specified statement.
|
void |
removeValues()
Removes all values of this case statement.
|
void |
setDefault(boolean isDefault)
Sets default type of this case statement object.
|
void |
setParent(CfgStatement parent)
Sets the specified statement as parent.
|
add, apply, contains, containStatements, equals, getDefines, getDescription, getId, getParent, getStatement, getStatement, getStatementNum, getUses, hashCode, hasParent, indexOf, isType, removeAll, removeStatement
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
public CfgCaseStatement(ru.ispras.fortress.expression.NodeValue value)
value
- case valuejava.lang.IllegalArgumentException
- when argument is null
.public CfgCaseStatement(java.util.Collection<ru.ispras.fortress.expression.NodeValue> values)
values
- case valuesjava.lang.IllegalArgumentException
- when argument is null
.RetrascopeRuntimeException
- when values are not of the same data type.public CfgCaseStatement(boolean defaultNode)
defaultNode
- default typepublic java.util.Set<ru.ispras.fortress.expression.NodeValue> getValues()
public boolean isDefault()
public void setDefault(boolean isDefault)
isDefault
- default typeRetrascopeRuntimeException
- when argument is true
and this statement already contains related NodeValue
valuespublic void add(ru.ispras.fortress.expression.NodeValue value)
value
- case valueRetrascopeRuntimeException
- when this object is of default kind.public void remove(ru.ispras.fortress.expression.NodeValue value)
value
- case valuepublic void removeValues()
public java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Identifiable
printer
- Printer that provides an output string format.public CfgStatementType getType()
CfgStatement
getType
in class CfgStatement
public CfgStatement deepCopy()
CfgStatement
deepCopy
in class CfgStatement
public void setParent(CfgStatement parent)
CfgStatement
setParent
in class CfgStatement
parent
- Statement to be set as parent.public void removeParent(CfgStatement parent)
CfgStatement
The specified statement should be a parent statement for this before this method.
removeParent
in class CfgStatement
parent
- parent statementpublic void add(CfgStatement statement)
CfgStatement
add
in class CfgStatement
statement
- Statement to be added.public void remove(CfgStatement statement)
CfgStatement
remove
in class CfgStatement
statement
- Statement to be removed from child statements.public void addAll(java.util.List<CfgStatement> list)
CfgStatement
addAll
in class CfgStatement
list
- Children statements to be added.