/** * Removes from the receiver all elements whose index is between * <code>from</code>, inclusive and <code>to</code>, inclusive. Shifts any succeeding * elements to the left (reduces their index). * This call shortens the list by <tt>(to - from + 1)</tt> elements. * * @param from index of first element to be removed. * @param to index of last element to be removed. * @exception IndexOutOfBoundsException index is out of range (<tt>size()>0 && (from<0 || from>to || to>=size())</tt>). */ public void removeFromTo(int from, int to) { checkRangeFromTo(from, to, size); int numMoved = size - to - 1; if (numMoved >= 0) { System.arraycopy(elements, to+1, elements, from, numMoved); fillFromToWith(from+numMoved, size-1, null); //delta } int width = to-from+1; if (width>0) size -= width; } /**
/** * Removes from the receiver all elements whose index is between * <code>from</code>, inclusive and <code>to</code>, inclusive. Shifts any succeeding * elements to the left (reduces their index). * This call shortens the list by <tt>(to - from + 1)</tt> elements. * * @param from index of first element to be removed. * @param to index of last element to be removed. * @exception IndexOutOfBoundsException index is out of range (<tt>size()>0 && (from<0 || from>to || to>=size())</tt>). */ public void removeFromTo(int from, int to) { checkRangeFromTo(from, to, size); int numMoved = size - to - 1; if (numMoved >= 0) { System.arraycopy(elements, to+1, elements, from, numMoved); fillFromToWith(from+numMoved, size-1, null); //delta } int width = to-from+1; if (width>0) size -= width; } /**
/** * Removes from the receiver all elements whose index is between * <code>from</code>, inclusive and <code>to</code>, inclusive. Shifts any * succeeding elements to the left (reduces their index). This call shortens * the list by <tt>(to - from + 1)</tt> elements. * * @param from * index of first element to be removed. * @param to * index of last element to be removed. * @exception IndexOutOfBoundsException * index is out of range ( * <tt>size()>0 && (from<0 || from>to || to>=size())</tt> * ). */ public void removeFromTo(int from, int to) { checkRangeFromTo(from, to, size); int numMoved = size - to - 1; if (numMoved >= 0) { System.arraycopy(elements, to + 1, elements, from, numMoved); fillFromToWith(from + numMoved, size - 1, null); // delta } int width = to - from + 1; if (width > 0) size -= width; }
/** * Removes all (key,value) associations from the receiver. * Implicitly calls <tt>trimToSize()</tt>. */ public void clear() { new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE); new ObjectArrayList(values).fillFromToWith(0, state.length-1, null); // delta this.distinct = 0; this.freeEntries = table.length; // delta trimToSize(); } /**
/** * Removes all (key,value) associations from the receiver. Implicitly calls * <tt>trimToSize()</tt>. */ public void clear() { new ByteArrayList(this.state).fillFromToWith(0, this.state.length - 1, FREE); new ObjectArrayList(values).fillFromToWith(0, state.length - 1, null); // delta this.distinct = 0; this.freeEntries = table.length; // delta trimToSize(); }
/** * Removes all (key,value) associations from the receiver. * Implicitly calls <tt>trimToSize()</tt>. */ public void clear() { new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE); new ObjectArrayList(values).fillFromToWith(0, state.length-1, null); // delta this.distinct = 0; this.freeEntries = table.length; // delta trimToSize(); } /**
/** * Removes all (key,value) associations from the receiver. * Implicitly calls <tt>trimToSize()</tt>. */ public void clear() { new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE); new ObjectArrayList(values).fillFromToWith(0, state.length-1, null); // delta this.distinct = 0; this.freeEntries = table.length; // delta trimToSize(); } /**
/** * Removes all (key,value) associations from the receiver. * Implicitly calls <tt>trimToSize()</tt>. */ public void clear() { new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE); new ObjectArrayList(values).fillFromToWith(0, state.length-1, null); // delta this.distinct = 0; this.freeEntries = table.length; // delta trimToSize(); } /**
/** * Removes all (key,value) associations from the receiver. Implicitly calls <tt>trimToSize()</tt>. */ public void clear() { new ByteArrayList(this.state).fillFromToWith(0, this.state.length - 1, FREE); new ObjectArrayList(values).fillFromToWith(0, state.length - 1, null); // delta this.distinct = 0; this.freeEntries = table.length; // delta trimToSize(); }