Return the first index of a particular value.
(int what)
| 415 | |
| 416 | /** Return the first index of a particular value. */ |
| 417 | public int index(int what) { |
| 418 | /* |
| 419 | if (indexCache != null) { |
| 420 | try { |
| 421 | return indexCache.get(what); |
| 422 | } catch (Exception e) { // not there |
| 423 | return -1; |
| 424 | } |
| 425 | } |
| 426 | */ |
| 427 | for (int i = 0; i < count; i++) { |
| 428 | if (data[i] == what) { |
| 429 | return i; |
| 430 | } |
| 431 | } |
| 432 | return -1; |
| 433 | } |
| 434 | |
| 435 | |
| 436 | // !!! TODO this is not yet correct, because it's not being reset when |