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

Constructor Index

 o ForStatement()
Allocates a new ForStatement object.
 o ForStatement(ExpressionList, Expression, ExpressionList, StatementList)
Allocates a new ForStatement object.
 o ForStatement(ForStatement. ForInit, Expression, ExpressionList, StatementList)
Allocates a new ForStatement object.

Method Index

 o getCondition()
Gets the condition part of this for-statement.
 o getIncrement()
Gets the increments part of this for-statement.
 o getInit()
Gets the initialization part of this for-statement.
 o getStatements()
Gets the body of this for-statement.
 o setCondition(Expression)
Sets the condition part of this for-statement.
 o setIncrement(ExpressionList)
Sets the increments part of this for-statement.
 o setInit(ExpressionList)
Sets the initialization part of this for-statement.
 o setInit(ForStatement. ForInit)
Sets the initialization part of this for-statement.
 o setStatements(StatementList)
Sets the body of this for-statement.
 o writeCode()
Writes the code this parse-tree presents for.

Constructors

 o ForStatement
 public ForStatement()
Allocates a new ForStatement object.

 o 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.
 o 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.

Methods

 o writeCode
 public void writeCode()
Writes the code this parse-tree presents for.

Overrides:
writeCode in class NonLeaf
 o getInit
 public List getInit()
Gets the initialization part of this for-statement.

Returns:
the initialization part.
 o setInit
 public void setInit(ForStatement. ForInit init)
Sets the initialization part of this for-statement.

Parameters:
init - the initialization part.
 o setInit
 public void setInit(ExpressionList init)
Sets the initialization part of this for-statement.

Parameters:
init - the initialization part.
 o getCondition
 public Expression getCondition()
Gets the condition part of this for-statement.

Returns:
the expression of the condtion part.
 o setCondition
 public void setCondition(Expression cond)
Sets the condition part of this for-statement.

Parameters:
cond - the expression of the condtion part.
 o getIncrement
 public ExpressionList getIncrement()
Gets the increments part of this for-statement.

Returns:
the expression list of the increments part.
 o setIncrement
 public void setIncrement(ExpressionList incs)
Sets the increments part of this for-statement.

Parameters:
incs - the expression list of the increments part.
 o getStatements
 public StatementList getStatements()
Gets the body of this for-statement.

Returns:
the statement list of the body.
 o 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