Return the first index of a particular value.
(String what)
| 436 | |
| 437 | /** Return the first index of a particular value. */ |
| 438 | public int index(String what) { |
| 439 | if (what == null) { |
| 440 | for (int i = 0; i < count; i++) { |
| 441 | if (data[i] == null) { |
| 442 | return i; |
| 443 | } |
| 444 | } |
| 445 | } else { |
| 446 | for (int i = 0; i < count; i++) { |
| 447 | if (what.equals(data[i])) { |
| 448 | return i; |
| 449 | } |
| 450 | } |
| 451 | } |
| 452 | return -1; |
| 453 | } |
| 454 | |
| 455 | |
| 456 | /** |