(int index)
| 632 | |
| 633 | |
| 634 | public int removeIndex(int index) { |
| 635 | if (index < 0 || index >= count) { |
| 636 | throw new ArrayIndexOutOfBoundsException(index); |
| 637 | } |
| 638 | int value = values[index]; |
| 639 | indices.remove(keys[index]); |
| 640 | for (int i = index; i < count-1; i++) { |
| 641 | keys[i] = keys[i+1]; |
| 642 | values[i] = values[i+1]; |
| 643 | indices.put(keys[i], i); |
| 644 | } |
| 645 | count--; |
| 646 | keys[count] = null; |
| 647 | values[count] = 0; |
| 648 | return value; |
| 649 | } |
| 650 | |
| 651 | |
| 652 | public void swap(int a, int b) { |