polyglot.ast
Interface Switch
- All Superinterfaces:
- java.lang.Cloneable, CompoundStmt, Copy, JL, Node, NodeOps, Stmt, Term
- All Known Implementing Classes:
- Switch_c
public interface Switch
- extends CompoundStmt
A Switch
is an immutable representation of a Java
switch
statement. Such a statement has an expression which
is evaluated to determine where to branch to, an a list of labels
and block statements which are conditionally evaluated. One of the
labels, rather than having a constant expression, may be lablled
default.
Method Summary |
java.util.List |
elements()
List of switch elements: case statements or blocks. |
Switch |
elements(java.util.List elements)
Set the list of switch elements: case statements or blocks. |
Expr |
expr()
The expression on which to switch. |
Switch |
expr(Expr expr)
Set the expression on which to switch. |
Methods inherited from interface polyglot.ast.Node |
childExpectedType, del, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitChild, visitEdge, visitList |
Methods inherited from interface polyglot.ast.JL |
init, node |
Methods inherited from interface polyglot.ast.NodeOps |
addDecls, buildTypes, buildTypesEnter, checkConstants, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChildren |
Methods inherited from interface polyglot.util.Copy |
copy |
expr
Expr expr()
- The expression on which to switch.
expr
Switch expr(Expr expr)
- Set the expression on which to switch.
elements
java.util.List elements()
- List of switch elements: case statements or blocks.
- Returns:
- A list of
SwitchElement
.
elements
Switch elements(java.util.List elements)
- Set the list of switch elements: case statements or blocks.
- Parameters:
elements
- A list of SwitchElement
.