/** Inserts all elements of the specified collection before the specified position into the receiver. * Shifts the element * currently at that position (if any) and any subsequent elements to * the right (increases their indices). * * @param index index before which to insert first element from the specified collection. * @param collection the collection to be inserted * @exception ClassCastException if an element in the collection is not * of the same parameter type of the receiver. * @throws IndexOutOfBoundsException if <tt>index < 0 || index > size()</tt>. */ public void beforeInsertAllOf(int index, java.util.Collection collection) { this.beforeInsertDummies(index, collection.size()); this.replaceFromWith(index, collection); } /**
/** Inserts all elements of the specified collection before the specified position into the receiver. * Shifts the element * currently at that position (if any) and any subsequent elements to * the right (increases their indices). * * @param index index before which to insert first element from the specified collection. * @param collection the collection to be inserted * @exception ClassCastException if an element in the collection is not * of the same parameter type of the receiver. * @throws IndexOutOfBoundsException if <tt>index < 0 || index > size()</tt>. */ public void beforeInsertAllOf(int index, java.util.Collection collection) { this.beforeInsertDummies(index, collection.size()); this.replaceFromWith(index, collection); } /**
/** * Inserts all elements of the specified collection before the specified * position into the receiver. Shifts the element currently at that position * (if any) and any subsequent elements to the right (increases their * indexes). * * @param index * index before which to insert first element from the specified * collection. * @param collection * the collection to be inserted * @exception ClassCastException * if an element in the collection is not of the same * parameter type of the receiver. * @throws IndexOutOfBoundsException * if <tt>index < 0 || index > size()</tt>. */ public void beforeInsertAllOf(int index, java.util.Collection collection) { this.beforeInsertDummies(index, collection.size()); this.replaceFromWith(index, collection); }
/** * Inserts all elements of the specified collection before the specified * position into the receiver. Shifts the element currently at that position * (if any) and any subsequent elements to the right (increases their * indices). * * @param index * index before which to insert first element from the specified * collection. * @param collection * the collection to be inserted * @exception ClassCastException * if an element in the collection is not of the same * parameter type of the receiver. * @throws IndexOutOfBoundsException * if <tt>index < 0 || index > size()</tt>. */ public void beforeInsertAllOf(int index, java.util.Collection collection) { this.beforeInsertDummies(index, collection.size()); this.replaceFromWith(index, collection); }
/** * Inserts all elements of the specified collection before the specified * position into the receiver. Shifts the element currently at that position * (if any) and any subsequent elements to the right (increases their * indexes). * * @param index * index before which to insert first element from the specified * collection. * @param collection * the collection to be inserted * @exception ClassCastException * if an element in the collection is not of the same * parameter type of the receiver. * @throws IndexOutOfBoundsException * if <tt>index < 0 || index > size()</tt>. */ public void beforeInsertAllOf(int index, java.util.Collection collection) { this.beforeInsertDummies(index, collection.size()); this.replaceFromWith(index, collection); }
/** * Sets the size of the receiver. * If the new size is greater than the current size, new null or zero items are added to the end of the receiver. * If the new size is less than the current size, all components at index newSize and greater are discarded. * This method does not release any superfluos internal memory. Use method <tt>trimToSize</tt> to release superfluos internal memory. * @param newSize the new size of the receiver. * @throws IndexOutOfBoundsException if <tt>newSize < 0</tt>. */ public void setSize(int newSize) { if (newSize<0) throw new IndexOutOfBoundsException("newSize:"+newSize); int currentSize = size(); if (newSize!=currentSize) { if (newSize>currentSize) beforeInsertDummies(currentSize,newSize-currentSize); else if (newSize<currentSize) removeFromTo(newSize, currentSize-1); } } /**
/** * Sets the size of the receiver. * If the new size is greater than the current size, new null or zero items are added to the end of the receiver. * If the new size is less than the current size, all components at index newSize and greater are discarded. * This method does not release any superfluos internal memory. Use method <tt>trimToSize</tt> to release superfluos internal memory. * @param newSize the new size of the receiver. * @throws IndexOutOfBoundsException if <tt>newSize < 0</tt>. */ public void setSize(int newSize) { if (newSize<0) throw new IndexOutOfBoundsException("newSize:"+newSize); int currentSize = size(); if (newSize!=currentSize) { if (newSize>currentSize) beforeInsertDummies(currentSize,newSize-currentSize); else if (newSize<currentSize) removeFromTo(newSize, currentSize-1); } } /**
/** * Sets the size of the receiver. If the new size is greater than the * current size, new null or zero items are added to the end of the * receiver. If the new size is less than the current size, all components * at index newSize and greater are discarded. This method does not release * any superfluos internal memory. Use method <tt>trimToSize</tt> to release * superfluos internal memory. * * @param newSize * the new size of the receiver. * @throws IndexOutOfBoundsException * if <tt>newSize < 0</tt>. */ public void setSize(int newSize) { if (newSize < 0) throw new IndexOutOfBoundsException("newSize:" + newSize); int currentSize = size(); if (newSize != currentSize) { if (newSize > currentSize) beforeInsertDummies(currentSize, newSize - currentSize); else if (newSize < currentSize) removeFromTo(newSize, currentSize - 1); } }
/** * Sets the size of the receiver. If the new size is greater than the * current size, new null or zero items are added to the end of the * receiver. If the new size is less than the current size, all components * at index newSize and greater are discarded. This method does not release * any superfluos internal memory. Use method <tt>trimToSize</tt> to release * superfluos internal memory. * * @param newSize * the new size of the receiver. * @throws IndexOutOfBoundsException * if <tt>newSize < 0</tt>. */ public void setSize(int newSize) { if (newSize < 0) throw new IndexOutOfBoundsException("newSize:" + newSize); int currentSize = size(); if (newSize != currentSize) { if (newSize > currentSize) beforeInsertDummies(currentSize, newSize - currentSize); else if (newSize < currentSize) removeFromTo(newSize, currentSize - 1); } }
/** * Sets the size of the receiver. If the new size is greater than the * current size, new null or zero items are added to the end of the * receiver. If the new size is less than the current size, all components * at index newSize and greater are discarded. This method does not release * any superfluos internal memory. Use method <tt>trimToSize</tt> to release * superfluos internal memory. * * @param newSize * the new size of the receiver. * @throws IndexOutOfBoundsException * if <tt>newSize < 0</tt>. */ public void setSize(int newSize) { if (newSize < 0) throw new IndexOutOfBoundsException("newSize:" + newSize); int currentSize = size(); if (newSize != currentSize) { if (newSize > currentSize) beforeInsertDummies(currentSize, newSize - currentSize); else if (newSize < currentSize) removeFromTo(newSize, currentSize - 1); } }