(final boolean reverse)
| 511 | |
| 512 | |
| 513 | private void sortImpl(final boolean reverse) { |
| 514 | new Sort() { |
| 515 | @Override |
| 516 | public int size() { |
| 517 | return count; |
| 518 | } |
| 519 | |
| 520 | @Override |
| 521 | public int compare(int a, int b) { |
| 522 | int diff = data[a].compareToIgnoreCase(data[b]); |
| 523 | return reverse ? -diff : diff; |
| 524 | } |
| 525 | |
| 526 | @Override |
| 527 | public void swap(int a, int b) { |
| 528 | String temp = data[a]; |
| 529 | data[a] = data[b]; |
| 530 | data[b] = temp; |
| 531 | } |
| 532 | }.run(); |
| 533 | } |
| 534 | |
| 535 | |
| 536 | // use insert() |
no test coverage detected