net.sf.cglib.util
public abstract class StringSwitcher extends Object
| Nested Class Summary | |
|---|---|
| static class | StringSwitcher.Generator |
| Method Summary | |
|---|---|
| static StringSwitcher | create(String[] strings, int[] ints, boolean fixedInput)
Helper method to create a StringSwitcher.
|
| abstract int | intValue(String s)
Return the integer associated with the given key. |
Parameters: strings the array of String keys; must be the same length as the value array ints the array of integer results; must be the same length as the key array fixedInput if false, an unknown key will be returned from StringSwitcher as -1; if true,
the result will be undefined, and the resulting code will be faster
Parameters: s the key
Returns: the associated integer value, or -1 if the key is unknown (unless
fixedInput was specified when this StringSwitcher was created,
in which case the return value for an unknown key is undefined)