| 629 | /// |
| 630 | /// - #size |
| 631 | public synchronized void insertElementAt(E object, int location) { |
| 632 | if (0 <= location && location <= elementCount) { |
| 633 | if (elementCount == elementData.length) { |
| 634 | growByOne(); |
| 635 | } |
| 636 | int count = elementCount - location; |
| 637 | if (count > 0) { |
| 638 | System.arraycopy(elementData, location, elementData, |
| 639 | location + 1, count); |
| 640 | } |
| 641 | elementData[location] = object; |
| 642 | elementCount++; |
| 643 | modCount++; |
| 644 | } else { |
| 645 | throw new ArrayIndexOutOfBoundsException(location); |
| 646 | } |
| 647 | } |
| 648 | |
| 649 | /// Returns if this vector has no elements, a size of zero. |
| 650 | /// |