All Packages Class Hierarchy This Package Previous Next Index
Class openjava.ptree.ForStatement
java.lang.Object
|
+----openjava.ptree.PtreeObject
|
+----openjava.ptree.NonLeaf
|
+----openjava.ptree.ForStatement
- public class ForStatement
- extends NonLeaf
- implements Statement, Ptree
The ForStatement
class represents a for statement
node of parse tree.
The specification of the initialization part may be modified
in the later version of OpenJava.
- See Also:
- Ptree, NonLeaf, Statement, Expression, ExpressionList, StatementList
-
ForStatement()
- Allocates a new ForStatement object.
-
ForStatement(ExpressionList, Expression, ExpressionList, StatementList)
- Allocates a new ForStatement object.
-
ForStatement(ForStatement. ForInit, Expression, ExpressionList, StatementList)
- Allocates a new ForStatement object.
-
getCondition()
- Gets the condition part of this for-statement.
-
getIncrement()
- Gets the increments part of this for-statement.
-
getInit()
- Gets the initialization part of this for-statement.
-
getStatements()
- Gets the body of this for-statement.
-
setCondition(Expression)
- Sets the condition part of this for-statement.
-
setIncrement(ExpressionList)
- Sets the increments part of this for-statement.
-
setInit(ExpressionList)
- Sets the initialization part of this for-statement.
-
setInit(ForStatement. ForInit)
- Sets the initialization part of this for-statement.
-
setStatements(StatementList)
- Sets the body of this for-statement.
-
writeCode()
- Writes the code this parse-tree presents for.
ForStatement
public ForStatement()
- Allocates a new ForStatement object.
ForStatement
public ForStatement(ForStatement. ForInit init,
Expression expr,
ExpressionList itarator,
StatementList stmts)
- Allocates a new ForStatement object.
- Parameters:
- init - the initialization part.
- expr - the condition part.
- iterator - the increments part.
- stmts - the stement list of the body.
ForStatement
public ForStatement(ExpressionList init,
Expression expr,
ExpressionList iterator,
StatementList stmts)
- Allocates a new ForStatement object.
- Parameters:
- init - the initialization part.
- expr - the condition part.
- iterator - the increments part.
- stmts - the stement list of the body.
writeCode
public void writeCode()
- Writes the code this parse-tree presents for.
- Overrides:
- writeCode in class NonLeaf
getInit
public List getInit()
- Gets the initialization part of this for-statement.
- Returns:
- the initialization part.
setInit
public void setInit(ForStatement. ForInit init)
- Sets the initialization part of this for-statement.
- Parameters:
- init - the initialization part.
setInit
public void setInit(ExpressionList init)
- Sets the initialization part of this for-statement.
- Parameters:
- init - the initialization part.
getCondition
public Expression getCondition()
- Gets the condition part of this for-statement.
- Returns:
- the expression of the condtion part.
setCondition
public void setCondition(Expression cond)
- Sets the condition part of this for-statement.
- Parameters:
- cond - the expression of the condtion part.
getIncrement
public ExpressionList getIncrement()
- Gets the increments part of this for-statement.
- Returns:
- the expression list of the increments part.
setIncrement
public void setIncrement(ExpressionList incs)
- Sets the increments part of this for-statement.
- Parameters:
- incs - the expression list of the increments part.
getStatements
public StatementList getStatements()
- Gets the body of this for-statement.
- Returns:
- the statement list of the body.
setStatements
public void setStatements(StatementList stmts)
- Sets the body of this for-statement.
- Parameters:
- stmts - the statement list of the body.
All Packages Class Hierarchy This Package Previous Next Index