/** * 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 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); }
/** * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection. * Does not alter the size of the receiver. * Replaces exactly <tt>Math.max(0,Math.min(size()-from, other.size()))</tt> elements. * * @param from the index at which to copy the first element from the specified collection. * @param other Collection to replace part of the receiver * @exception IndexOutOfBoundsException index is out of range (index < 0 || index >= size()). */ public void replaceFromWith(int from, java.util.Collection other) { checkRange(from,size()); java.util.Iterator e = other.iterator(); int index=from; int limit = Math.min(size()-from, other.size()); for (int i=0; i<limit; i++) set(index++,((Number) e.next()).intValue()); //delta } /**
/** * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection. * Does not alter the size of the receiver. * Replaces exactly <tt>Math.max(0,Math.min(size()-from, other.size()))</tt> elements. * * @param from the index at which to copy the first element from the specified collection. * @param other Collection to replace part of the receiver * @exception IndexOutOfBoundsException index is out of range (index < 0 || index >= size()). */ public void replaceFromWith(int from, java.util.Collection other) { checkRange(from,size()); java.util.Iterator e = other.iterator(); int index=from; int limit = Math.min(size()-from, other.size()); for (int i=0; i<limit; i++) set(index++,((Number) e.next()).intValue()); //delta } /**
/** * Replaces the part of the receiver starting at <code>from</code> * (inclusive) with all the elements of the specified collection. Does not * alter the size of the receiver. Replaces exactly * <tt>Math.max(0,Math.min(size()-from, other.size()))</tt> elements. * * @param from * the index at which to copy the first element from the * specified collection. * @param other * Collection to replace part of the receiver * @exception IndexOutOfBoundsException * index is out of range (index < 0 || index >= * size()). */ public void replaceFromWith(int from, java.util.Collection other) { checkRange(from, size()); java.util.Iterator e = other.iterator(); int index = from; int limit = Math.min(size() - from, other.size()); for (int i = 0; i < limit; i++) set(index++, ((Number) e.next()).intValue()); // delta }
/** * Replaces the element at the specified position in this list with the * specified element (optional operation). <p> * * @param index index of element to replace. * @param element element to be stored at the specified position. * @return the element previously at the specified position. * * @throws ClassCastException if the class of the specified element * prevents it from being added to this list. * @throws IllegalArgumentException if some aspect of the specified * element prevents it from being added to this list. * * @throws IndexOutOfBoundsException if the specified index is out of * range (<tt>index < 0 || index >= size()</tt>). */ public Object set(int index, Object element) { Object old = get(index); content.set(index,value(element)); return old; } /**
/** * Replaces the element at the specified position in this list with the * specified element (optional operation). <p> * * @param index index of element to replace. * @param element element to be stored at the specified position. * @return the element previously at the specified position. * * @throws ClassCastException if the class of the specified element * prevents it from being added to this list. * @throws IllegalArgumentException if some aspect of the specified * element prevents it from being added to this list. * * @throws IndexOutOfBoundsException if the specified index is out of * range (<tt>index < 0 || index >= size()</tt>). */ public Object set(int index, Object element) { Object old = get(index); content.set(index,value(element)); return old; } /**