
JVM, Class Files, and the CLEmitter 335
public void a d d LO O KUP S WIT C HIn s tru c tio n ( S t ring d e f aultLabel ,
int numPairs ,
TreeMap < Integer , String >
matc h L abel P a irs )
where defaultLabel is the jump label for the default value, numPairs is the number of
pairs in the match table, and the matchLabelPairs is the key match table.
Mnemonic Operation Operand Stack
tableswitch Access jump table by in-
dex match and jump
· · · , index ⇒ · · ·
The above instruction can be added to the code section of a method by sending the
CLEmitter instance the following message:
public void a d d TA B L ES W ITC H I ns t ruc t i on ( String defaultLabel