code: public void set(int index, double element) {
  	// overridden for performance only.
  	if (index >= size || index < 0)
  		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
  	elements[index] = element;
  }
docs: Replaces the element at the specified position in the receiver with the specified element.
  
  @param index index of element to replace.
  @param element element to be stored at the specified position.
  @exception IndexOutOfBoundsException index is out of range (index
  &lt; 0 || index &gt;= size()).