Class JStmtBlock
- java.lang.Object
-
- com.inductiveautomation.snap.javatree.JNode
-
- com.inductiveautomation.snap.javatree.JStmt
-
- com.inductiveautomation.snap.javatree.JStmtBlock
-
public class JStmtBlock extends JStmt
A Java statement for a block of statements.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.List<JStmt>statements
-
Constructor Summary
Constructors Constructor Description JStmtBlock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStatement(JStmt aStmt, int anIndex)Adds a statement.JStmtBlockgetBlock()Returns the statement block.java.util.List<JStmt>getStatements()Returns the list of statements.JVariableDeclgetVariableDeclInside(java.lang.String aName)Returns a variable with given name.java.util.List<JVariableDecl>getVariableDecls(java.lang.String aPrefix, java.util.List<JVariableDecl> theVariables)Returns a variable with given name.booleanisBlock()Returns whether statement has a block associated with it.JStmtremoveStatement(int anIndex)Removes a statement.intremoveStatement(JStmt aStmt)Removes a statement.-
Methods inherited from class com.inductiveautomation.snap.javatree.JNode
addChild, buildChildren, getChild, getChildCount, getChildren, getClassLoader, getClassName, getClassNameImpl, getClassRef, getClassRefImpl, getEnclosingClassDecl, getEnclosingMemberDecl, getEnclosingMethodDecl, getEnd, getEndToken, getFile, getJClass, getLineIndex, getName, getNameImpl, getNodeAtCharIndex, getNodeFields, getNodeFieldsImpl, getNodeParents, getNodePath, getNodeString, getOthers, getParent, getParent, getReferencedClasses, getReferencedClassNames, getReferencedClassNames, getReferencedClassNames, getStart, getStartToken, getString, getVariableDecl, setClassName, setClassRef, setEndToken, setJClass, setParent, setStartToken, toString
-
-
-
-
Field Detail
-
statements
public java.util.List<JStmt> statements
-
-
Method Detail
-
getStatements
public java.util.List<JStmt> getStatements()
Returns the list of statements.
-
isBlock
public boolean isBlock()
Returns whether statement has a block associated with it.
-
getBlock
public JStmtBlock getBlock()
Returns the statement block.
-
addStatement
public void addStatement(JStmt aStmt, int anIndex)
Adds a statement.
-
removeStatement
public JStmt removeStatement(int anIndex)
Removes a statement.
-
removeStatement
public int removeStatement(JStmt aStmt)
Removes a statement.
-
getVariableDeclInside
public JVariableDecl getVariableDeclInside(java.lang.String aName)
Returns a variable with given name.- Overrides:
getVariableDeclInsidein classJNode
-
getVariableDecls
public java.util.List<JVariableDecl> getVariableDecls(java.lang.String aPrefix, java.util.List<JVariableDecl> theVariables)
Returns a variable with given name.- Overrides:
getVariableDeclsin classJNode
-
-