(int index)
| 593 | |
| 594 | |
| 595 | public long removeIndex(int index) { |
| 596 | if (index < 0 || index >= count) { |
| 597 | throw new ArrayIndexOutOfBoundsException(index); |
| 598 | } |
| 599 | long value = values[index]; |
| 600 | indices.remove(keys[index]); |
| 601 | for (int i = index; i < count-1; i++) { |
| 602 | keys[i] = keys[i+1]; |
| 603 | values[i] = values[i+1]; |
| 604 | indices.put(keys[i], i); |
| 605 | } |
| 606 | count--; |
| 607 | keys[count] = null; |
| 608 | values[count] = 0; |
| 609 | return value; |
| 610 | } |
| 611 | |
| 612 | |
| 613 | public void swap(int a, int b) { |