Mimics the valueOf in an enumeration. @param str to be converted. @return corresponding value. @throws IllegalArgumentException if string doesn't correspond to a value.
(final String str)
| 170 | * @throws IllegalArgumentException if string doesn't correspond to a value. |
| 171 | */ |
| 172 | public static DNA valueOf(final String str) { |
| 173 | if (str.length() != 1) { |
| 174 | throw new IllegalArgumentException(); |
| 175 | } |
| 176 | return valueOf(str.charAt(0)); |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * Mimics the <code>valueOf</code> in an enumeration. |