jltools.ast
Interface Case

All Superinterfaces:
java.lang.Cloneable, Copy, Node, java.io.Serializable, Stmt, SwitchElement
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.
 
Methods inherited from interface jltools.ast.Node
buildTypes_, buildTypesOverride_, copy, disambiguate_, disambiguateOverride_, disambiguateTypes_, disambiguateTypesOverride_, dump, enterScope, exceptionCheck_, exceptionCheckOverride_, ext, ext, foldConstants_, foldConstantsOverride_, leaveScope, position, position, reconstructTypes_, translate_, typeCheck_, typeCheckOverride_, visit, visitChildren
 

Method Detail

expr

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

expr

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

isDefault

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

value

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