|
||||||||||
| 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.ForEachStatement
public class ForEachStatement
This class represents the foreach statement nodes of the syntax tree
| Constructor Summary | |
|---|---|
ForEachStatement(FormalParameter para,
Expression collection,
Node body)
Creates a new for statement |
|
ForEachStatement(FormalParameter para,
Expression coll,
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 |
|
void |
addVar(java.lang.String s)
|
|
Node |
getBody()
Returns the body of this statement |
|
Expression |
getCollection()
Gets the condition to evaluate at each loop |
|
FormalParameter |
getParameter()
Gets the initialization statements |
|
java.util.List<java.lang.String> |
getVars()
|
|
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 |
setCollection(Expression e)
Sets the condition to evaluate |
|
void |
setParameter(FormalParameter l)
Sets the initialization 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 ForEachStatement(FormalParameter para,
Expression collection,
Node body)
java.lang.IllegalArgumentException - if body is null
public ForEachStatement(FormalParameter para,
Expression coll,
Node body,
SourceInfo si)
body - the body
java.lang.IllegalArgumentException - if body is null| Method Detail |
|---|
public void addVar(java.lang.String s)
public java.util.List<java.lang.String> getVars()
public FormalParameter getParameter()
public void setParameter(FormalParameter l)
public Expression getCollection()
public void setCollection(Expression e)
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 | |||||||||