RECODER 0.92

recoder.java.statement
Class EnhancedFor

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.EnhancedFor
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ExpressionContainer, NonTerminalProgramElement, ProgramElement, ScopeDefiningElement, SourceElement, Statement, StatementContainer, VariableScope, ModelElement

public class EnhancedFor
extends LoopStatement
implements VariableScope

Author:
gutzmann This file is part of the RECODER library and protected by the LGPL.
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
  EnhancedFor()
           
protected EnhancedFor(EnhancedFor proto)
           
  EnhancedFor(Statement body)
           
 
Method Summary
 void accept(SourceVisitor v)
          Receive a visitor, for instance a pretty printer.
 void addVariableToScope(VariableSpecification var)
           
 EnhancedFor deepClone()
          Creates a deep clone of the current source element.
 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, getLastElement, 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, getLastElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
 
Methods inherited from interface recoder.ModelElement
validate
 

Constructor Detail

EnhancedFor

public EnhancedFor()

EnhancedFor

public EnhancedFor(Statement body)
Parameters:
body -

EnhancedFor

protected EnhancedFor(EnhancedFor proto)
Method Detail

isExitCondition

public boolean isExitCondition()
Description copied from class: LoopStatement
Is exit condition.

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

isCheckedBeforeIteration

public boolean isCheckedBeforeIteration()
Description copied from class: LoopStatement
Is checked before iteration.

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

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

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

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.

deepClone

public EnhancedFor deepClone()
Description copied from interface: SourceElement
Creates a deep clone of the current source element. For NonTerminalProgramElements, the parent roles are valid, except that the root element is not included anywhere and hence has no set parents, of course. This method also clones Comment s, but does not clone derived information such as scopes.

Specified by:
deepClone in interface SourceElement
Specified by:
deepClone in interface Statement
Specified by:
deepClone in class LoopStatement

RECODER 0.92