(int index)
| 623 | |
| 624 | |
| 625 | public double removeIndex(int index) { |
| 626 | if (index < 0 || index >= count) { |
| 627 | throw new ArrayIndexOutOfBoundsException(index); |
| 628 | } |
| 629 | double value = values[index]; |
| 630 | indices.remove(keys[index]); |
| 631 | for (int i = index; i < count-1; i++) { |
| 632 | keys[i] = keys[i+1]; |
| 633 | values[i] = values[i+1]; |
| 634 | indices.put(keys[i], i); |
| 635 | } |
| 636 | count--; |
| 637 | keys[count] = null; |
| 638 | values[count] = 0; |
| 639 | return value; |
| 640 | } |
| 641 | |
| 642 | |
| 643 | public void swap(int a, int b) { |