|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkoala.dynamicjava.tree.Node
koala.dynamicjava.tree.Statement
koala.dynamicjava.tree.ForSlashEachStatement
koala.dynamicjava.tree.ForStatement
public class ForStatement
This class represents the for statement nodes of the syntax tree
| Constructor Summary | |
|---|---|
ForStatement(java.util.List<Node> init,
Expression cond,
java.util.List<Node> updt,
Node body)
Creates a new for statement |
|
ForStatement(java.util.List<Node> init,
Expression cond,
java.util.List<Node> updt,
Node body,
SourceInfo si)
Creates a new for statement |
|
| Method Summary | ||
|---|---|---|
|
acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree |
|
void |
addLabel(java.lang.String label)
Adds a label to this statement |
|
Node |
getBody()
Returns the body of this statement |
|
Expression |
getCondition()
Gets the condition to evaluate at each loop |
|
java.util.List<Node> |
getInitialization()
Gets the initialization statements |
|
java.util.List<Node> |
getUpdate()
Gets the update statements |
|
boolean |
hasLabel(java.lang.String label)
Test whether this statement has the given label |
|
void |
setBody(Node node)
Sets the body of this statement |
|
void |
setCondition(Expression e)
Sets the condition to evaluate |
|
void |
setInitialization(java.util.List<Node> l)
Sets the initialization statements |
|
void |
setUpdate(java.util.List<Node> l)
Sets the update statements |
|
java.lang.String |
toString()
|
|
| Methods inherited from class koala.dynamicjava.tree.Node |
|---|
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ForStatement(java.util.List<Node> init,
Expression cond,
java.util.List<Node> updt,
Node body)
init - the initialization statementscond - the condition to evaluate at each loopupdt - the update statementsbody - the body
java.lang.IllegalArgumentException - if body is null
public ForStatement(java.util.List<Node> init,
Expression cond,
java.util.List<Node> updt,
Node body,
SourceInfo si)
init - the initialization statements (either Statements or declarations)cond - the condition to evaluate at each loopupdt - the update statements (either Statements or declarations)body - the body
java.lang.IllegalArgumentException - if body is null| Method Detail |
|---|
public java.util.List<Node> getInitialization()
public void setInitialization(java.util.List<Node> l)
public Expression getCondition()
public void setCondition(Expression e)
public java.util.List<Node> getUpdate()
public void setUpdate(java.util.List<Node> l)
public Node getBody()
public void setBody(Node node)
java.lang.IllegalArgumentException - if node is nullpublic void addLabel(java.lang.String label)
addLabel in interface ContinueTargetlabel - the label to add
java.lang.IllegalArgumentException - if label is nullpublic boolean hasLabel(java.lang.String label)
hasLabel in interface ContinueTargetpublic <T> T acceptVisitor(Visitor<T> visitor)
acceptVisitor in class Nodevisitor - the visitor to acceptpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||