public abstract class Statement extends MetaInfo implements Identifiable, UseDef
Modifier and Type | Method and Description |
---|---|
void |
add(Statement statement)
Adds the specified statement as child to this object.
|
void |
add(Statement statement,
int num)
Adds the specified child statement to this statement at the specified position.
|
void |
addAll(java.util.Collection<Statement> list)
Adds all the statements from the specified list as children.
|
void |
apply(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Applies bindings to this statement.
|
boolean |
contains(Statement statement)
Checks whether this statement contains the specified as the child.
|
boolean |
containStatements()
Checks whether this statement contains any other embedded statements.
|
abstract Statement |
deepCopy()
Returns a copy of this statement and all it's sub-statements.
|
boolean |
equals(java.lang.Object object) |
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Returns a set of defined variables.
|
java.lang.String |
getDescription()
Returns a
String description of the object in the format of the default system printer. |
java.lang.String |
getId()
Returns unique node identifier in string form.
|
Statement |
getParent()
Returns parent statement.
|
Statement |
getStatement(int num)
Returns a child statement of the specified number.
|
int |
getStatementNum()
Returns a number of child statements.
|
abstract java.lang.Enum<?> |
getType()
Returns statement type.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Returns a set of used variables.
|
int |
hashCode() |
int |
indexOf(Statement statement)
Returns index of the specified statement.
|
abstract boolean |
isSequential()
Checks whether statement is of sequential kind.
|
boolean |
isType(java.lang.Enum<?> type)
Checks whether this statement is of specified type.
|
void |
remove(Statement statement)
Removes the specified statement from children.
|
void |
removeAll()
Removes all the child statements.
|
void |
removeParent(Statement parent)
Removes link with the specified statement.
|
void |
setParent(Statement parent)
Sets the specified statement as parent.
|
addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getDescription
public abstract java.lang.Enum<?> getType()
public abstract boolean isSequential()
true
if it's sub-statements are treated as sequential,
false
otherwise.public boolean isType(java.lang.Enum<?> type)
type
- Statement type.true
if this statement is of the specified type,
false
otherwise.public boolean containStatements()
true
if this statement contains statements, false
otherwise.public abstract Statement deepCopy()
public int getStatementNum()
public Statement getStatement(int num)
num
- Child statement number.null
if there is no such.public java.lang.String getId()
getId
in interface Identifiable
public int indexOf(Statement statement)
statement
- Statement which index is returned.-1
otherwise.public boolean contains(Statement statement)
statement
- Statement which existence in this object is checked.true
if this object contains the specified statement, false
otherwise.public void add(Statement statement)
statement
- Statement to be added.java.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalArgumentException
- when this object already contains the specified statement.java.lang.IllegalArgumentException
- when the specified statement already has parent statement
and this parent is not equal to this statement.public void add(Statement statement, int num)
statement
- Statement to be added as child.num
- New child statement position number.java.lang.IndexOutOfBoundsException
- if position argument is greater or equal to this statement
children number, or less that 0
.public void remove(Statement statement)
statement
- Statement to be removed from child statements.java.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalArgumentException
- when this statement already contain the specified
statement as child.java.lang.IllegalArgumentException
- when the specified statement already has parent statement
and the parent statement is not equal to this statement.public void addAll(java.util.Collection<Statement> list)
list
- Children statements to be added.public void removeAll()
public Statement getParent()
public void setParent(Statement parent)
parent
- Statement to be set as parent.java.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalStateException
- when this statement already has non-null parent statement
and the parent statement does not equal to the specified statement.public void removeParent(Statement parent)
The specified statement should be a parent statement for this before this method.
parent
- parent statementjava.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalArgumentException
- when either this statement does not have parent
or it's parent is not equal to the specified statement.public void apply(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
bindings
- Pairs of variable names and bounded expressions.public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getUses()
UseDef
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getDefines()
UseDef
getDefines
in interface UseDef
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getDescription()
Identifiable
String
description of the object in the format of the default system printer.getDescription
in interface Identifiable