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

Method remove

classpath/java/util/ArrayList.java:139–154  ·  view source on GitHub ↗
(int index)

Source from the content-addressed store, hash-verified

137 }
138
139 public T remove(int index) {
140 T v = get(index);
141
142 int newSize = size - 1;
143
144 if (index == newSize) {
145 array[index] = null;
146 } else {
147 System.arraycopy(array, index + 1, array, index, newSize - index);
148 }
149
150 shrink(newSize);
151 size = newSize;
152
153 return v;
154 }
155
156 public boolean remove(Object element) {
157 for (int i = 0; i < size; ++i) {

Callers 2

testRemoveMethod · 0.95
mainMethod · 0.95

Calls 4

getMethod · 0.95
arraycopyMethod · 0.95
shrinkMethod · 0.95
equalMethod · 0.95

Tested by 2

testRemoveMethod · 0.76
mainMethod · 0.76