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)
| 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 |