Return a random value from the list. Throws an exception if there are no entries available. (Can't just return null because IntList and FloatList can't do that, and would be inconsistent.)
()
| 583 | * can't do that, and would be inconsistent.) |
| 584 | */ |
| 585 | public String choice() { |
| 586 | if (count == 0) { |
| 587 | throw new ArrayIndexOutOfBoundsException("No entries in this StringList"); |
| 588 | } |
| 589 | return data[(int) (Math.random() * count)]; |
| 590 | } |
| 591 | |
| 592 | |
| 593 | // removing in 4.0.2, seems like overkill... if something this specific is |