| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| pack-priv static interface |
| Modifier and Type | Field and Description |
|---|---|
| private static final Signature | |
| private static final StringSwitcher. | |
| private static final Type |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static StringSwitcher | create(String[]
the array of String keys; must be the same length as the value array strings, int[] the array of integer results; must be the same length as the key array ints, boolean if false, an unknown key will be returned from fixedInput)intValue as -1; if true,
the result will be undefined, and the resulting code will be fasterHelper method to create a StringSwitcher. |
| public abstract int |
| INT_VALUE | back to summary |
|---|---|
| private static final Signature INT_VALUE | |
| KEY_FACTORY | back to summary |
|---|---|
| private static final StringSwitcher. | |
| STRING_SWITCHER | back to summary |
|---|---|
| private static final Type STRING_SWITCHER | |
| StringSwitcher | back to summary |
|---|---|
| protected StringSwitcher() | |
| create | back to summary |
|---|---|
| public static StringSwitcher create(String[] strings, int[] ints, boolean fixedInput) Helper method to create a StringSwitcher. For finer control over the generated instance, use a new instance of StringSwitcher.Generator instead of this static method.
| |
| intValue | back to summary |
|---|---|
| public abstract int intValue(String s) Return the integer associated with the given key.
| |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private int[] | |
| private static final AbstractClassGenerator. | |
| private String[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public StringSwitcher | |
| protected Object | firstInstance(Class<T> type)
Implements abstract org.
|
| public void | |
| protected ClassLoader | |
| protected Object | nextInstance(Object instance)
Implements abstract org.
|
| public void | setFixedInput(boolean
if false, an unknown key will be returned from fixedInput)intValue as -1; if true,
the result will be undefined, and the resulting code will be fasterConfigure how unknown String keys will be handled. |
| public void | setInts(int[]
the array of integer results; must be the same length as the key array ints)Set the array of integer results. |
| public void | setStrings(String[]
the array of String keys; must be the same length as the value array strings)Set the array of recognized Strings. |
| fixedInput | back to summary |
|---|---|
| private boolean fixedInput | |
| ints | back to summary |
|---|---|
| private int[] ints | |
| SOURCE | back to summary |
|---|---|
| private static final AbstractClassGenerator. | |
| strings | back to summary |
|---|---|
| private String[] strings | |
| Generator | back to summary |
|---|---|
| public Generator() | |
| create | back to summary |
|---|---|
| public StringSwitcher create() Generate the | |
| firstInstance | back to summary |
|---|---|
| protected Object firstInstance(Class<T> type) Implements abstract org.
| |
| generateClass | back to summary |
|---|---|
| public void generateClass(ClassVisitor v) throws Exception Implements org.
| |
| getDefaultClassLoader | back to summary |
|---|---|
| protected ClassLoader getDefaultClassLoader() Implements abstract org.
| |
| nextInstance | back to summary |
|---|---|
| protected Object nextInstance(Object instance) Implements abstract org.
| |
| setFixedInput | back to summary |
|---|---|
| public void setFixedInput(boolean fixedInput) Configure how unknown String keys will be handled.
| |
| setInts | back to summary |
|---|---|
| public void setInts(int[] ints) Set the array of integer results.
| |
| setStrings | back to summary |
|---|---|
| public void setStrings(String[] strings) Set the array of recognized Strings. | |
| Modifier and Type | Method and Description |
|---|---|
| public Object |
| newInstance | back to summary |
|---|---|
| public Object newInstance(String[] strings, int[] ints, boolean fixedInput) | |