@ SuppressWarnings ( "unchecked" ) private void expandTable ( ) { int newCapacity = currentCapacity + increment ; if ( newCapacity < currentCapacity ) { throw new IllegalStateException ( "Attempt to expand LookupTable beyond maximum capacity" ) ; } E [ ] theNewArray = ( E [ ] ) new Object [ newCapacity ] ; System . arraycopy ( this . theElementArray , 0 , theNewArray , 0 , currentCapacity ) ; theElementArray = theNewArray ; currentCapacity = newCapacity ; }
Expands the lookup table to accommodate more elements . Does this by adding the expansion increment to the current capacity .