Return the first index of a particular value.
(String what)
| 440 | |
| 441 | /** Return the first index of a particular value. */ |
| 442 | public int index(String what) { |
| 443 | if (what == null) { |
| 444 | for (int i = 0; i < count; i++) { |
| 445 | if (data[i] == null) { |
| 446 | return i; |
| 447 | } |
| 448 | } |
| 449 | } else { |
| 450 | for (int i = 0; i < count; i++) { |
| 451 | if (what.equals(data[i])) { |
| 452 | return i; |
| 453 | } |
| 454 | } |
| 455 | } |
| 456 | return -1; |
| 457 | } |
| 458 | |
| 459 | |
| 460 | // !!! TODO this is not yet correct, because it's not being reset when |