public void setValue ( int position , double value ) { if ( position >= internalArray . length ) { double [ ] newArray = new double [ position + growingSize ] ; System . arraycopy ( internalArray , 0 , newArray , 0 , internalArray . length ) ; internalArray = newArray ; } internalArray [ position ] = value ; lastIndex = max ( lastIndex , position ) ; }
Safe set the value in a certain position .