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

Method setSize

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

Sets the size of this vector to the specified size. If there are more than length elements in this vector, the elements at end are lost. If there are less than length elements in the vector, the additional elements contain null. @param length the new size of this vector. @see #size

(int length)

Source from the content-addressed store, hash-verified

886 * @see #size
887 */
888 public synchronized void setSize(int length) {
889 if (length == elementCount) {
890 return;
891 }
892 ensureCapacity(length);
893 if (elementCount > length) {
894 Arrays.fill(elementData, length, elementCount, null);
895 }
896 elementCount = length;
897 modCount++;
898 }
899
900 /**
901 * Returns the number of elements in this vector.

Callers

nothing calls this directly

Calls 2

ensureCapacityMethod · 0.95
fillMethod · 0.95

Tested by

no test coverage detected