(int index)
| 604 | |
| 605 | |
| 606 | public int removeIndex(int index) { |
| 607 | if (index < 0 || index >= count) { |
| 608 | throw new ArrayIndexOutOfBoundsException(index); |
| 609 | } |
| 610 | int value = values[index]; |
| 611 | indices.remove(keys[index]); |
| 612 | for (int i = index; i < count-1; i++) { |
| 613 | keys[i] = keys[i+1]; |
| 614 | values[i] = values[i+1]; |
| 615 | indices.put(keys[i], i); |
| 616 | } |
| 617 | count--; |
| 618 | keys[count] = null; |
| 619 | values[count] = 0; |
| 620 | return value; |
| 621 | } |
| 622 | |
| 623 | |
| 624 | public void swap(int a, int b) { |