Randomize the order of the list elements. @webref stringlist:method @webBrief Randomize the order of the list elements
()
| 547 | * @webBrief Randomize the order of the list elements |
| 548 | */ |
| 549 | @SuppressWarnings("unused") |
| 550 | public void shuffle() { |
| 551 | Random r = new Random(); |
| 552 | int num = count; |
| 553 | while (num > 1) { |
| 554 | int value = r.nextInt(num); |
| 555 | num--; |
| 556 | String temp = data[num]; |
| 557 | data[num] = data[value]; |
| 558 | data[value] = temp; |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | |
| 563 | /** |