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

Method ensureCapacity

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

Ensures that this vector can hold the specified number of elements without growing. @param minimumCapacity the minimum number of elements that this vector will hold before growing. @see #capacity

(int minimumCapacity)

Source from the content-addressed store, hash-verified

343 * @see #capacity
344 */
345 public synchronized void ensureCapacity(int minimumCapacity) {
346 if (elementData.length < minimumCapacity) {
347 int next = (capacityIncrement <= 0 ? elementData.length
348 : capacityIncrement)
349 + elementData.length;
350 grow(minimumCapacity > next ? minimumCapacity : next);
351 }
352 }
353
354 /**
355 * Compares the specified object to this vector and returns if they are

Callers 5

setSizeMethod · 0.95
invoke2Method · 0.45
invoke4Method · 0.45
invoke9Method · 0.45
invoke46Method · 0.45

Calls 1

growMethod · 0.95

Tested by

no test coverage detected