gnu.bytecode
Class SwitchState
public class SwitchState
extends java.lang.Object
Maintains the state for generating a switch statement.
SwitchState
public SwitchState(CodeAttr code)
addCase
public boolean addCase(int value,
CodeAttr code)
Emit a new case, for the given value, whose label is here.
addCase
public boolean addCase(int value,
Label label,
CodeAttr code)
Add a new case.
value
- the case value to match against at run-timelabel
- the location to go to if the value matchescode
- the CodeAttr of the Method we are generating code for
- true on success; false if value duplicates an existing value
addDefault
public void addDefault(CodeAttr code)
finish
public void finish(CodeAttr code)
Handle the end of the switch statement.
Assume the case value is on the stack; go to the matching case label.
getMaxValue
public int getMaxValue()