| Modifier and Type | Field and Description |
|---|---|
| private final Select |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SWITCH(final int[]
array of match values (case 2: ... case 7: ..., etc.) match, final InstructionHandle[] the instructions to be branched to for each case targets, final InstructionHandle the default target target, final int maximum gap that may between case branches maxGap)Template for switch() constructs. |
| Modifier and Type | Method and Description |
|---|---|
| public Instruction | |
| public InstructionList | |
| private static boolean | Returns: match is sorted in ascending order with no gap bigger than maxGap?
|
| private static void | sort(final int l, final int r, final int[] match, final InstructionHandle[] targets)
Sorts match and targets array with QuickSort. |
| instruction | back to summary |
|---|---|
| private final Select instruction | |
| SWITCH | back to summary |
|---|---|
| public SWITCH(final int[] match, final InstructionHandle[] targets, final InstructionHandle target) | |
| SWITCH | back to summary |
|---|---|
| public SWITCH(final int[] match, final InstructionHandle[] targets, final InstructionHandle target, final int maxGap) Template for switch() constructs. If the match array can be sorted in ascending order with gaps no larger than maxGap between the numbers, a TABLESWITCH instruction is generated, and a LOOKUPSWITCH otherwise. The former may be more efficient, but needs more space. Note, that the key array always will be sorted, though we leave the original arrays unaltered.
| |
| getInstruction | back to summary |
|---|---|
| public Instruction getInstruction() | |
| getInstructionList | back to summary |
|---|---|
| public InstructionList getInstructionList() Implements org.
| |
| matchIsOrdered | back to summary |
|---|---|
private static boolean matchIsOrdered(final int[] match, final int matchLength, final int maxGap)
| |
| sort | back to summary |
|---|---|
| private static void sort(final int l, final int r, final int[] match, final InstructionHandle[] targets) Sorts match and targets array with QuickSort. | |