Ensures that after this operation the ArrayList can hold the specified number of elements without further growing. @param minimumCapacity the minimum capacity asked for.
(int minimumCapacity)
| 321 | * the minimum capacity asked for. |
| 322 | */ |
| 323 | public void ensureCapacity(int minimumCapacity) { |
| 324 | if (array.length < minimumCapacity) { |
| 325 | // REVIEW: Why do we check the firstIndex first? Growing |
| 326 | // the end makes more sense |
| 327 | if (firstIndex > 0) { |
| 328 | growAtFront(minimumCapacity - array.length); |
| 329 | } else { |
| 330 | growAtEnd(minimumCapacity - array.length); |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | @Override |
| 336 | public E get(int location) { |
nothing calls this directly
no test coverage detected