MCPcopy Index your code
hub / github.com/codenameone/CodenameOne / insertElementAt

Method insertElementAt

vm/JavaAPI/src/java/util/Vector.java:552–568  ·  view source on GitHub ↗

Inserts the specified object into this vector at the specified location. This object is inserted before any previous element at the specified location. All elements with an index equal or greater than location have their index increased by 1. If the location is equal to the size of this vect

(E object, int location)

Source from the content-addressed store, hash-verified

550 * @see #size
551 */
552 public synchronized void insertElementAt(E object, int location) {
553 if (0 <= location && location <= elementCount) {
554 if (elementCount == elementData.length) {
555 growByOne();
556 }
557 int count = elementCount - location;
558 if (count > 0) {
559 System.arraycopy(elementData, location, elementData,
560 location + 1, count);
561 }
562 elementData[location] = object;
563 elementCount++;
564 modCount++;
565 } else {
566 throw new ArrayIndexOutOfBoundsException(location);
567 }
568 }
569
570 /**
571 * Returns if this vector has no elements, a size of zero.

Callers 15

placeInStorageCacheMethod · 0.95
addMethod · 0.95
pushMethod · 0.45
addSortedToQueueMethod · 0.45
addToQueueMethod · 0.45
runCurrentRequestMethod · 0.45
nextAPMethod · 0.45
addCommandMethod · 0.45
setBackCommandMethod · 0.45
addCommandMethod · 0.45
commitRowMethod · 0.45

Calls 2

growByOneMethod · 0.95
arraycopyMethod · 0.95

Tested by

no test coverage detected