public class Case extends BranchImp implements ExpressionContainer
| Modifier and Type | Field and Description | 
|---|---|
protected ImmutableArray<Statement> | 
body
Body. 
 | 
protected Expression | 
expression
Expression. 
 | 
| Constructor and Description | 
|---|
Case()
Case. 
 | 
Case(Expression e)
Case. 
 | 
Case(Expression e,
    Statement[] body)
Case. 
 | 
Case(ExtList children,
    Expression expr,
    PositionInfo pos)
Constructor for the transformation of COMPOST ASTs to KeY. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
ImmutableArray<Statement> | 
getBody()
The body may be empty (null), to define a fall-through. 
 | 
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. 
 | 
Expression | 
getExpression()
Get expression. 
 | 
Expression | 
getExpressionAt(int index)  | 
int | 
getExpressionCount()
Get the number of expressions in this container. 
 | 
Statement | 
getStatementAt(int index)  | 
int | 
getStatementCount()
Get the number of statements in this container. 
 | 
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, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetComments, matchequalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPositionprotected final Expression expression
protected final ImmutableArray<Statement> body
public Case()
public Case(Expression e)
e - an expression.public Case(Expression e, Statement[] body)
e - an expression.body - a statement mutable list.public Case(ExtList children, Expression expr, PositionInfo pos)
children - the children of this AST element as KeY classes.
 May contain: Comments
              a Statement (as the statement following case)
 Must NOT contain: an Expression indicating the condition of the case
 as there are classes that are Expression and Statement, so they might
 get mixed up. Use the second parameter of this constructor for the
 expression.expr - the expression of the casepublic 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 int getStatementCount()
getStatementCount in interface StatementContainerpublic Statement getStatementAt(int index)
getStatementAt in interface StatementContainerpublic Expression getExpression()
public ImmutableArray<Statement> getBody()
EmptyStatement would create a single ";".public 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.