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

Method growBy

vm/JavaAPI/src/java/util/Vector.java:447–465  ·  view source on GitHub ↗
(int required)

Source from the content-addressed store, hash-verified

445 }
446
447 private void growBy(int required) {
448 int adding = 0;
449 if (capacityIncrement <= 0) {
450 if ((adding = elementData.length) == 0) {
451 adding = required;
452 }
453 while (adding < required) {
454 adding += adding;
455 }
456 } else {
457 adding = (required / capacityIncrement) * capacityIncrement;
458 if (adding < required) {
459 adding += capacityIncrement;
460 }
461 }
462 E[] newData = newElementArray(elementData.length + adding);
463 System.arraycopy(elementData, 0, newData, 0, elementCount);
464 elementData = newData;
465 }
466
467 /**
468 * Returns an integer hash code for the receiver. Objects which are equal

Callers 1

addAllMethod · 0.95

Calls 2

newElementArrayMethod · 0.95
arraycopyMethod · 0.95

Tested by

no test coverage detected