/** * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. * Shifts the element currently at that position (if any) and * any subsequent elements to the right. * <b>This method must set the new size to be <tt>size()+length</tt>. * * @param index index before which to insert dummy elements (must be in [0,size]).. * @param length number of dummy elements to be inserted. * @throws IndexOutOfBoundsException if <tt>index < 0 || index > size()</tt>. */ protected void beforeInsertDummies(int index, int length) { if (index > size || index < 0) throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size); if (length > 0) { ensureCapacity(size + length); setSizeRaw(size + length); replaceFromToWithFrom(index+length,size-1,this,index); } } /**
/** * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. * Shifts the element currently at that position (if any) and * any subsequent elements to the right. * <b>This method must set the new size to be <tt>size()+length</tt>. * * @param index index before which to insert dummy elements (must be in [0,size]).. * @param length number of dummy elements to be inserted. * @throws IndexOutOfBoundsException if <tt>index < 0 || index > size()</tt>. */ protected void beforeInsertDummies(int index, int length) { if (index > size || index < 0) throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size); if (length > 0) { ensureCapacity(size + length); setSizeRaw(size + length); replaceFromToWithFrom(index+length,size-1,this,index); } } /**
/** * Inserts <tt>length</tt> dummy elements before the specified position into * the receiver. Shifts the element currently at that position (if any) and * any subsequent elements to the right. <b>This method must set the new * size to be <tt>size()+length</tt></b>. * * @param index * index before which to insert dummy elements (must be in * [0,size]).. * @param length * number of dummy elements to be inserted. * @throws IndexOutOfBoundsException * if <tt>index < 0 || index > size()</tt>. */ protected void beforeInsertDummies(int index, int length) { if (index > size || index < 0) throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size); if (length > 0) { ensureCapacity(size + length); setSizeRaw(size + length); replaceFromToWithFrom(index + length, size - 1, this, index); } }