/** * Removes all of the elements from this list. This * list will be empty after this call returns (unless * it throws an exception). */ public void clear() { /* // this is the quick way, but would force us // to break all the cursors _modCount++; _head.setNext(null); _head.setPrev(null); _size = 0; */ Iterator it = iterator(); while(it.hasNext()) { it.next(); it.remove(); } }
public Iterator iterator() { checkForComod(); return super.iterator(); }
/** * Retains only the elements in this list that are contained in the * specified collection. In other words, removes * from this list all the elements that are not contained in the specified * collection. * * @param c collection that defines which elements this set will retain. * * @return <tt>true</tt> if this list changed as a result of the call. */ public boolean retainAll(Collection c) { boolean changed = false; Iterator it = iterator(); while(it.hasNext()) { if(!c.contains(it.next())) { it.remove(); changed = true; } } return changed; }
public Iterator iterator() { checkForComod(); return super.iterator(); }
/** * Removes from this list all the elements that are contained in the * specified collection. * * @param c collection that defines which elements will be removed from * this list. * @return <tt>true</tt> if this list changed as a result of the call. */ public boolean removeAll(Collection c) { if(0 == c.size() || 0 == _size) { return false; } else { boolean changed = false; Iterator it = iterator(); while(it.hasNext()) { if(c.contains(it.next())) { it.remove(); changed = true; } } return changed; } }
/** * Removes all of the elements from this list. This * list will be empty after this call returns (unless * it throws an exception). */ public void clear() { /* // this is the quick way, but would force us // to break all the cursors _modCount++; _head.setNext(null); _head.setPrev(null); _size = 0; */ Iterator it = iterator(); while(it.hasNext()) { it.next(); it.remove(); } }
/** * Retains only the elements in this list that are contained in the * specified collection. In other words, removes * from this list all the elements that are not contained in the specified * collection. * * @param c collection that defines which elements this set will retain. * * @return <tt>true</tt> if this list changed as a result of the call. */ public boolean retainAll(Collection c) { boolean changed = false; Iterator it = iterator(); while(it.hasNext()) { if(!c.contains(it.next())) { it.remove(); changed = true; } } return changed; }
/** * Removes from this list all the elements that are contained in the * specified collection. * * @param c collection that defines which elements will be removed from * this list. * @return <tt>true</tt> if this list changed as a result of the call. */ public boolean removeAll(Collection c) { if(0 == c.size() || 0 == _size) { return false; } else { boolean changed = false; Iterator it = iterator(); while(it.hasNext()) { if(c.contains(it.next())) { it.remove(); changed = true; } } return changed; } }
/** * Removes all of the elements from this list. This * list will be empty after this call returns (unless * it throws an exception). */ public void clear() { /* // this is the quick way, but would force us // to break all the cursors _modCount++; _head.setNext(null); _head.setPrev(null); _size = 0; */ Iterator it = iterator(); while(it.hasNext()) { it.next(); it.remove(); } }
/** * Removes all of the elements from this list. This * list will be empty after this call returns (unless * it throws an exception). */ public void clear() { /* // this is the quick way, but would force us // to break all the cursors _modCount++; _head.setNext(null); _head.setPrev(null); _size = 0; */ Iterator it = iterator(); while(it.hasNext()) { it.next(); it.remove(); } }
/** * Removes all of the elements from this list. This * list will be empty after this call returns (unless * it throws an exception). */ public void clear() { /* // this is the quick way, but would force us // to break all the cursors _modCount++; _head.setNext(null); _head.setPrev(null); _size = 0; */ Iterator it = iterator(); while(it.hasNext()) { it.next(); it.remove(); } }
public Iterator iterator() { checkForComod(); return super.iterator(); }
public Iterator iterator() { checkForComod(); return super.iterator(); }
/** * Retains only the elements in this list that are contained in the * specified collection. In other words, removes * from this list all the elements that are not contained in the specified * collection. * * @param c collection that defines which elements this set will retain. * * @return <tt>true</tt> if this list changed as a result of the call. */ public boolean retainAll(Collection c) { boolean changed = false; Iterator it = iterator(); while(it.hasNext()) { if(!c.contains(it.next())) { it.remove(); changed = true; } } return changed; }
public Iterator iterator() { checkForComod(); return super.iterator(); }
/** * Retains only the elements in this list that are contained in the * specified collection. In other words, removes * from this list all the elements that are not contained in the specified * collection. * * @param c collection that defines which elements this set will retain. * * @return <tt>true</tt> if this list changed as a result of the call. */ public boolean retainAll(Collection c) { boolean changed = false; Iterator it = iterator(); while(it.hasNext()) { if(!c.contains(it.next())) { it.remove(); changed = true; } } return changed; }
/** * Retains only the elements in this list that are contained in the * specified collection. In other words, removes * from this list all the elements that are not contained in the specified * collection. * * @param c collection that defines which elements this set will retain. * * @return <tt>true</tt> if this list changed as a result of the call. */ public boolean retainAll(Collection c) { boolean changed = false; Iterator it = iterator(); while(it.hasNext()) { if(!c.contains(it.next())) { it.remove(); changed = true; } } return changed; }
public Iterator iterator() { checkForComod(); return super.iterator(); }
public Iterator iterator() { checkForComod(); return super.iterator(); }