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

Method ensureCapacity

Ports/CLDC11/src/java/util/ArrayList.java:312–323  ·  view source on GitHub ↗
(int minimumCapacity)

Source from the content-addressed store, hash-verified

310 ///
311 /// - `minimumCapacity`: the minimum capacity asked for.
312 public void ensureCapacity(int minimumCapacity) {
313 int required = minimumCapacity - array.length;
314 if (required > 0) {
315 // REVIEW: Why do we check the firstIndex first? Growing
316 // the end makes more sense
317 if (firstIndex > 0) {
318 growAtFront(required);
319 } else {
320 growAtEnd(required);
321 }
322 }
323 }
324
325 @Override
326 public E get(int location) {

Callers

nothing calls this directly

Calls 2

growAtFrontMethod · 0.95
growAtEndMethod · 0.95

Tested by

no test coverage detected