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)
| 367 | * @see #capacity |
| 368 | */ |
| 369 | public synchronized void ensureCapacity(int minimumCapacity) { |
| 370 | if (elementData.length < minimumCapacity) { |
| 371 | int next = (capacityIncrement <= 0 ? elementData.length |
| 372 | : capacityIncrement) |
| 373 | + elementData.length; |
| 374 | grow(minimumCapacity > next ? minimumCapacity : next); |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | /** |
| 379 | * Compares the specified object to this vector and returns if they are |