MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / insertElementAt

Method insertElementAt

Ports/CLDC11/src/java/util/Vector.java:631–647  ·  view source on GitHub ↗
(E object, int location)

Source from the content-addressed store, hash-verified

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 ///

Callers 1

addMethod · 0.95

Calls 2

growByOneMethod · 0.95
arraycopyMethod · 0.95

Tested by

no test coverage detected