/** * Called to indicate that the data storage has been cleared. * This implementation calls {@link #didRemove didRemove} for each object; * clients can use this to monitor clearing of the data storage. * @param size the original size of the list. * @param oldObjects the old data storage being discarded. * @see #didRemove */ protected void didClear(int size, Object [] oldObjects) { if (oldObjects != null) { for (int i = 0; i < size; ++i) { @SuppressWarnings("unchecked") E object = (E)oldObjects[i]; didRemove(i, object); } } }