/** * Inserts the specified element before the specified position into the receiver. * Shifts the element currently at that position (if any) and * any subsequent elements to the right. * * @param index index before which the specified element is to be inserted (must be in [0,size]). * @param element element to be inserted. * @exception IndexOutOfBoundsException index is out of range (<tt>index < 0 || index > size()</tt>). */ public void beforeInsert(int index, int element) { beforeInsertDummies(index,1); set(index,element); } /**
/** * Inserts the specified element before the specified position into the receiver. * Shifts the element currently at that position (if any) and * any subsequent elements to the right. * * @param index index before which the specified element is to be inserted (must be in [0,size]). * @param element element to be inserted. * @exception IndexOutOfBoundsException index is out of range (<tt>index < 0 || index > size()</tt>). */ public void beforeInsert(int index, int element) { beforeInsertDummies(index,1); set(index,element); } /**
/** * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. * Shifts the element currently at that position (if any) and * any subsequent elements to the right. * * @param index index before which to insert first element from the specified list (must be in [0,size]).. * @param other list of which a part is to be inserted into the receiver. * @param from the index of the first element to be inserted (inclusive). * @param to the index of the last element to be inserted (inclusive). * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()>0 && (from<0 || from>to || to>=other.size())</tt>). * @exception IndexOutOfBoundsException index is out of range (<tt>index < 0 || index > size()</tt>). */ public void beforeInsertAllOfFromTo(int index, AbstractIntList other, int from, int to) { int length=to-from+1; this.beforeInsertDummies(index, length); this.replaceFromToWithFrom(index, index+length-1, other, from); } /**
/** * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. * Shifts the element currently at that position (if any) and * any subsequent elements to the right. * * @param index index before which to insert first element from the specified list (must be in [0,size]).. * @param other list of which a part is to be inserted into the receiver. * @param from the index of the first element to be inserted (inclusive). * @param to the index of the last element to be inserted (inclusive). * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()>0 && (from<0 || from>to || to>=other.size())</tt>). * @exception IndexOutOfBoundsException index is out of range (<tt>index < 0 || index > size()</tt>). */ public void beforeInsertAllOfFromTo(int index, AbstractIntList other, int from, int to) { int length=to-from+1; this.beforeInsertDummies(index, length); this.replaceFromToWithFrom(index, index+length-1, other, from); } /**
/** * Inserts the specified element before the specified position into the * receiver. Shifts the element currently at that position (if any) and any * subsequent elements to the right. * * @param index * index before which the specified element is to be inserted * (must be in [0,size]). * @param element * element to be inserted. * @exception IndexOutOfBoundsException * index is out of range ( * <tt>index < 0 || index > size()</tt>). */ public void beforeInsert(int index, int element) { beforeInsertDummies(index, 1); set(index, element); }
/** * Inserts the part of the specified list between <code>otherFrom</code> * (inclusive) and <code>otherTo</code> (inclusive) before the specified * position into the receiver. Shifts the element currently at that position * (if any) and any subsequent elements to the right. * * @param index * index before which to insert first element from the specified * list (must be in [0,size]).. * @param other * list of which a part is to be inserted into the receiver. * @param from * the index of the first element to be inserted (inclusive). * @param to * the index of the last element to be inserted (inclusive). * @exception IndexOutOfBoundsException * index is out of range ( * <tt>other.size()>0 && (from<0 || from>to || to>=other.size())</tt> * ). * @exception IndexOutOfBoundsException * index is out of range ( * <tt>index < 0 || index > size()</tt>). */ public void beforeInsertAllOfFromTo(int index, AbstractIntList other, int from, int to) { int length = to - from + 1; this.beforeInsertDummies(index, length); this.replaceFromToWithFrom(index, index + length - 1, other, from); }
beforeInsertDummies(theLast+1, diff);
beforeInsertDummies(theLast+1, diff);
beforeInsertDummies(theLast + 1, diff); } else { if (diff < 0) {