polyglot.ast
Interface Case

All Superinterfaces:
java.lang.Cloneable, Copy, JL, Node, NodeOps, Stmt, SwitchElement, Term
All Known Implementing Classes:
Case_c

public interface Case
extends SwitchElement

A Case is a representation of a Java case statement. It can only be contained in a Switch.


Method Summary
 Expr expr()
          Get the case label.
 Case expr(Expr expr)
          Set the case label.
 boolean isDefault()
          Returns true iff this is the default case.
 long value()
          Returns the value of the case label.
 Case value(long value)
          Set the value of the case label.
 
Methods inherited from interface polyglot.ast.Term
acceptCFG, entry, exceptions, exceptions, reachable, reachable
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
 
Methods inherited from interface polyglot.ast.JL
init, node
 
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, visitChildren
 
Methods inherited from interface polyglot.util.Copy
copy
 

Method Detail

expr

Expr expr()
Get the case label. This must should a constant expression. The case label is null for the default case.


expr

Case expr(Expr expr)
Set the case label. This must should a constant expression, or null.


isDefault

boolean isDefault()
Returns true iff this is the default case.


value

long value()
Returns the value of the case label. This value is only valid after type-checking.


value

Case value(long value)
Set the value of the case label.