public void add ( int index , float e ) { if ( index < 0 || index > size ) { throw new IndexOutOfBoundsException ( ) ; } ensureCapacity ( size + 1 ) ; if ( index < size ) { for ( int i = size ; i > index ; i -- ) { elements [ i ] = elements [ i - 1 ] ; } } elements [ index ] = e ; size ++ ; }
Inserts a value into the array at the specified index .