类 StringSwitcher
java.lang.Object
cn.taketoday.bytecode.util.StringSwitcher
This class implements a simple String->int mapping for a fixed set of keys.
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringSwitcherHelper method to create a StringSwitcher.abstract intReturn the integer associated with the given key.
-
构造器详细资料
-
StringSwitcher
protected StringSwitcher()
-
-
方法详细资料
-
create
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.- 参数:
strings- the array of String keys; must be the same length as the value arrayints- the array of integer results; must be the same length as the key arrayfixedInput- if false, an unknown key will be returned fromintValue(java.lang.String)as-1; if true, the result will be undefined, and the resulting code will be faster
-
intValue
Return the integer associated with the given key.- 参数:
s- the key- 返回:
- the associated integer value, or
-1if the key is unknown (unlessfixedInputwas specified when thisStringSwitcherwas created, in which case the return value for an unknown key is undefined)
-