Return a random value from the list.
()
| 678 | * Return a random value from the list. |
| 679 | */ |
| 680 | public int choice() { |
| 681 | if (count == 0) { |
| 682 | throw new ArrayIndexOutOfBoundsException("No entries in this IntList"); |
| 683 | } |
| 684 | return data[(int) (Math.random() * count)]; |
| 685 | } |
| 686 | |
| 687 | |
| 688 | // see notes in StringList |