Randomize the order of the list elements. @webref floatlist:method @webBrief Randomize the order of the list elements
()
| 669 | * @webBrief Randomize the order of the list elements |
| 670 | */ |
| 671 | @SuppressWarnings("unused") |
| 672 | public void shuffle() { |
| 673 | Random r = new Random(); |
| 674 | int num = count; |
| 675 | while (num > 1) { |
| 676 | int value = r.nextInt(num); |
| 677 | num--; |
| 678 | float temp = data[num]; |
| 679 | data[num] = data[value]; |
| 680 | data[value] = temp; |
| 681 | } |
| 682 | } |
| 683 | |
| 684 | |
| 685 | /** |