public void ensureCapacity ( int size ) { if ( size > elements . length ) { reallocate ( Math . max ( size , 2 * elements . length ) ) ; } }
Ensures that there is enough room in the array to hold the specified number of elements .