public class If extends BranchStatement implements ExpressionContainer
| Modifier and Type | Field and Description | 
|---|---|
protected Else | 
elseBranch
Else branch. 
 | 
protected Expression | 
expression
Expression. 
 | 
protected Then | 
thenBranch
Then branch. 
 | 
| Constructor and Description | 
|---|
If(Expression e,
  Then thenBranch)
If. 
 | 
If(Expression e,
  Then thenBranch,
  Else elseBranch)
If. 
 | 
If(ExtList children)
Constructor for the transformation of COMPOST ASTs to KeY. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
private void | 
checkValidity()
throws an exception if the if-statement guard or then-branch are null 
 | 
Branch | 
getBranchAt(int index)  | 
int | 
getBranchCount()
Get the number of branches in this container. 
 | 
ProgramElement | 
getChildAt(int index)
Returns the child at the specified index in this node's "virtual"
      child array 
 | 
int | 
getChildCount()
Returns the number of children of this node. 
 | 
Else | 
getElse()
Get else. 
 | 
Expression | 
getExpression()
Get expression. 
 | 
Expression | 
getExpressionAt(int index)  | 
int | 
getExpressionCount()
Get the number of expressions in this container. 
 | 
SourceElement | 
getLastElement()
Finds the source element that occurs last in the source. 
 | 
Then | 
getThen()
Get then. 
 | 
void | 
prettyPrint(PrettyPrinter p)
Pretty printing the source element. 
 | 
void | 
visit(Visitor v)
calls the corresponding method of a visitor in order to
 perform some action/transformation on this element 
 | 
compatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildrengetComments, hashCode, prettyPrintMain, reuseSignaturegetEndPosition, getFirstElement, getFirstElementIncludingBlocks, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetComments, matchequalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getPositionInfo, getRelativePosition, getStartPositionprotected Then thenBranch
protected Else elseBranch
protected Expression expression
public If(ExtList children)
children - the children of this AST element as KeY classes.
 May contain: Comments, a Then, an Else, an Expression (as condition of If)public If(Expression e, Then thenBranch)
e - an expression.thenBranch - a then.public If(Expression e, Then thenBranch, Else elseBranch)
e - an expression.thenBranch - a then.elseBranch - an else.private void checkValidity()
public SourceElement getLastElement()
JavaSourceElementgetLastElement in interface SourceElementgetLastElement in class JavaSourceElementJavaSourceElement.toSource(), 
JavaSourceElement.getEndPosition()public int getChildCount()
getChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
getChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException - if index is out
                 of boundspublic int getExpressionCount()
getExpressionCount in interface ExpressionContainerpublic Expression getExpressionAt(int index)
getExpressionAt in interface ExpressionContainerpublic Expression getExpression()
public Then getThen()
public Else getElse()
public int getBranchCount()
getBranchCount in class BranchStatementpublic Branch getBranchAt(int index)
getBranchAt in class BranchStatementpublic void visit(Visitor v)
visit in interface SourceElementv - the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaProgramElementp - a pretty printer.java.io.IOException - occasionally thrown.