MCPcopy Create free account
hub / github.com/ReadyTalk/avian / add

Method add

classpath/java/util/ArrayList.java:85–91  ·  view source on GitHub ↗
(int index, T element)

Source from the content-addressed store, hash-verified

83 }
84
85 public void add(int index, T element) {
86 int newSize = Math.max(size+1, index+1);
87 grow(newSize);
88 size = newSize;
89 System.arraycopy(array, index, array, index+1, size-index-1);
90 array[index] = element;
91 }
92
93 public boolean add(T element) {
94 add(size, element);

Callers 13

testGrowMethod · 0.95
testRemoveMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
testSortMethod · 0.95
getResourcesMethod · 0.95
makeClassMethod · 0.95
parseTypeMethod · 0.95
getFieldsMethod · 0.95
addAllMethod · 0.95
singletonListMethod · 0.95

Calls 3

maxMethod · 0.95
growMethod · 0.95
arraycopyMethod · 0.95

Tested by 6

testGrowMethod · 0.76
testRemoveMethod · 0.76
mainMethod · 0.76
mainMethod · 0.76
mainMethod · 0.76
testSortMethod · 0.76