RECODER 0.92

recoder.java.statement
Class For

java.lang.Object
  extended by recoder.java.JavaSourceElement
      extended by recoder.java.JavaProgramElement
          extended by recoder.java.JavaNonTerminalProgramElement
              extended by recoder.java.statement.JavaStatement
                  extended by recoder.java.statement.LoopStatement
                      extended by recoder.java.statement.For
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ExpressionContainer, NonTerminalProgramElement, ProgramElement, ScopeDefiningElement, SourceElement, Statement, StatementContainer, VariableScope, ModelElement

public class For
extends LoopStatement
implements VariableScope

For.

Author:
AutoDoc
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface recoder.java.ProgramElement
ProgramElement.TreeStructure
 
Nested classes/interfaces inherited from interface recoder.java.SourceElement
SourceElement.Position
 
Field Summary
 
Fields inherited from class recoder.java.JavaSourceElement
factory
 
Fields inherited from interface recoder.java.ProgramElement
STRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE
 
Constructor Summary
  For()
          For.
  For(ASTList<LoopInitializer> inits, Expression guard, ASTList<Expression> updates, Statement body)
          For.
protected For(For proto)
          For.
 
Method Summary
 void accept(SourceVisitor v)
          Receive a visitor, for instance a pretty printer.
 void addVariableToScope(VariableSpecification var)
           
 For deepClone()
          Deep clone.
 SourceElement getLastElement()
          Finds the source element that occurs last in the source.
 VariableSpecification getVariableInScope(java.lang.String name)
           
 java.util.List<VariableSpecification> getVariablesInScope()
           
 boolean isCheckedBeforeIteration()
          Is checked before iteration.
 boolean isDefinedScope()
          Check if the scope has been set up.
 boolean isExitCondition()
          Is exit condition.
 void removeVariableFromScope(java.lang.String name)
           
 void setDefinedScope(boolean defined)
          Sets the scope to be defined or undefined.
 
Methods inherited from class recoder.java.statement.LoopStatement
getBody, getChildAt, getChildCount, getChildPositionCode, getExpressionAt, getExpressionCount, getGuard, getInitializers, getStatementAt, getStatementCount, getUpdates, makeParentRoleValid, replaceChild, setBody, setGuard, setInitializers, setUpdates
 
Methods inherited from class recoder.java.statement.JavaStatement
getASTParent, getStatementContainer, setStatementContainer
 
Methods inherited from class recoder.java.JavaNonTerminalProgramElement
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll
 
Methods inherited from class recoder.java.JavaProgramElement
getComments, getID, setComments, validate
 
Methods inherited from class recoder.java.JavaSourceElement
getEndPosition, getFactory, getFirstElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface recoder.java.NonTerminalProgramElement
getChildAt, getChildCount, getChildPositionCode, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, makeParentRoleValid, replaceChild, validateAll
 
Methods inherited from interface recoder.java.ProgramElement
getASTParent, getComments, getID, setComments
 
Methods inherited from interface recoder.java.SourceElement
getEndPosition, getFactory, getFirstElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
 
Methods inherited from interface recoder.ModelElement
validate
 

Constructor Detail

For

public For()
For.


For

public For(ASTList<LoopInitializer> inits,
           Expression guard,
           ASTList<Expression> updates,
           Statement body)
For.

Parameters:
inits - a loop initializer mutable list.
guard - an expression.
updates - an expression mutable list.
body - a statement.

For

protected For(For proto)
For.

Parameters:
proto - a for.
Method Detail

deepClone

public For deepClone()
Deep clone.

Specified by:
deepClone in interface SourceElement
Specified by:
deepClone in interface Statement
Specified by:
deepClone in class LoopStatement
Returns:
the object.

getLastElement

public SourceElement getLastElement()
Description copied from class: JavaSourceElement
Finds the source element that occurs last in the source. The default implementation returns this element, which is correct for all terminal program elements, and many non terminals such as statements and prefixed operators.

Specified by:
getLastElement in interface SourceElement
Overrides:
getLastElement in class JavaSourceElement
Returns:
the last source element in the syntactical representation of this element, may be equals to this element.
See Also:
JavaSourceElement.toSource(), JavaSourceElement.getEndPosition()

isExitCondition

public boolean isExitCondition()
Is exit condition.

Specified by:
isExitCondition in class LoopStatement
Returns:
the boolean value.

isCheckedBeforeIteration

public boolean isCheckedBeforeIteration()
Is checked before iteration.

Specified by:
isCheckedBeforeIteration in class LoopStatement
Returns:
the boolean value.

isDefinedScope

public boolean isDefinedScope()
Description copied from interface: ScopeDefiningElement
Check if the scope has been set up.

Specified by:
isDefinedScope in interface ScopeDefiningElement

setDefinedScope

public void setDefinedScope(boolean defined)
Description copied from interface: ScopeDefiningElement
Sets the scope to be defined or undefined. If set to defined, the scope cache becomes initialized. If set to undefined, the scope cache becomes erased.

Specified by:
setDefinedScope in interface ScopeDefiningElement

getVariablesInScope

public java.util.List<VariableSpecification> getVariablesInScope()
Specified by:
getVariablesInScope in interface VariableScope

getVariableInScope

public VariableSpecification getVariableInScope(java.lang.String name)
Specified by:
getVariableInScope in interface VariableScope

addVariableToScope

public void addVariableToScope(VariableSpecification var)
Specified by:
addVariableToScope in interface VariableScope

removeVariableFromScope

public void removeVariableFromScope(java.lang.String name)
Specified by:
removeVariableFromScope in interface VariableScope

accept

public void accept(SourceVisitor v)
Description copied from interface: SourceElement
Receive a visitor, for instance a pretty printer.

Specified by:
accept in interface SourceElement
Parameters:
v - a source visitor.

RECODER 0.92