org.inxar.jenesis
Interface For

All Superinterfaces:
Block, Codeable, ConditionalStatement, Statement

public interface For
extends ConditionalStatement

Statement subinterface for the for construct. It has an declaration statement, a conditional statement, and an update statement (all of which are optional).


Method Summary
 void addInit(Expression expr)
          Adds this statement expression to the comma separated list of initialization expressions.
 void addUpdate(Expression update)
          Adds this declaration statement to the list of updates.
 Iterator getInits()
          Gets the comma separated list of initialzers from this for statement as an iterator of Expression OR a single Let object (depending on how it was defined).
 Iterator getUpdates()
          Gets the comma separated list of updates from this for statement as an iterator of Expression.
 Let setInit(Type type)
          Sets this declaration statement to a Let statement with the given Type.
 
Methods inherited from interface org.inxar.jenesis.ConditionalStatement
getPredicate, setPredicate
 
Methods inherited from interface org.inxar.jenesis.Statement
comment, getLabel, setLabel
 
Methods inherited from interface org.inxar.jenesis.Codeable
getComment, setComment, toCode, vm
 
Methods inherited from interface org.inxar.jenesis.Block
getStatements, newBreak, newContinue, newDoWhile, newEmpty, newFor, newIf, newLet, newLocalBlock, newLocalClass, newReturn, newStmt, newSwitch, newSynchronized, newThrow, newTry, newWhile
 

Method Detail

setInit

public Let setInit(Type type)
Sets this declaration statement to a Let statement with the given Type. If any initialization expressions have previously been added through the addInit(Expression) method, they will all be overwritten. This is because the Java Language Specification allows the initialization section of the for statement to be a Let expression.

addInit

public void addInit(Expression expr)
Adds this statement expression to the comma separated list of initialization expressions.

getInits

public Iterator getInits()
Gets the comma separated list of initialzers from this for statement as an iterator of Expression OR a single Let object (depending on how it was defined). One need check the RTTI to be sure.

getUpdates

public Iterator getUpdates()
Gets the comma separated list of updates from this for statement as an iterator of Expression.

addUpdate

public void addUpdate(Expression update)
Adds this declaration statement to the list of updates.