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)
| 310 | * the minimum capacity asked for. |
| 311 | */ |
| 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) { |
nothing calls this directly
no test coverage detected