Gets the numeric value corresponding to a text mnemonic. @param str The text mnemonic @return The corresponding numeric value, or -1 if there is none
(String str)
| 187 | * @return The corresponding numeric value, or -1 if there is none |
| 188 | */ |
| 189 | public int |
| 190 | getValue(String str) { |
| 191 | str = sanitize(str); |
| 192 | Integer value = (Integer) strings.get(str); |
| 193 | if (value != null) { |
| 194 | return value.intValue(); |
| 195 | } |
| 196 | if (prefix != null) { |
| 197 | if (str.startsWith(prefix)) { |
| 198 | int val = parseNumeric(str.substring(prefix.length())); |
| 199 | if (val >= 0) { |
| 200 | return val; |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | if (numericok) { |
| 205 | return parseNumeric(str); |
| 206 | } |
| 207 | return -1; |
| 208 | } |
| 209 | |
| 210 | } |
no test coverage detected