/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ public boolean addAll(Collection<? extends E> collection) { boolean changed = false; int size = collection.size(); ensureCapacity(size); Iterator<? extends E> it = collection.iterator(); while (size-- > 0) { if (add(it.next())) { changed = true; } } return changed; }
/** See {@link gnu.trove.set.hash.THashSet#ensureCapacity(int)} */ public void ensureCapacity(int desiredCapacity) { delegate.ensureCapacity(desiredCapacity); }
/** See {@link gnu.trove.set.hash.THashSet#ensureCapacity(int)} */ public void ensureCapacity(int desiredCapacity) { delegate.ensureCapacity(desiredCapacity); }
/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ public boolean addAll(Collection<? extends E> collection) { boolean changed = false; int size = collection.size(); ensureCapacity(size); Iterator<? extends E> it = collection.iterator(); while (size-- > 0) { if (add(it.next())) { changed = true; } } return changed; }
/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ @Override public boolean addAll(Collection<? extends E> collection) { boolean changed = false; int size = collection.size(); ensureCapacity(size); Iterator<? extends E> it = collection.iterator(); while (size-- > 0) { if (add(it.next())) { changed = true; } } return changed; }
/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ public boolean addAll(Collection<? extends E> collection) { boolean changed = false; int size = collection.size(); ensureCapacity(size); Iterator<? extends E> it = collection.iterator(); while (size-- > 0) { if (add(it.next())) { changed = true; } } return changed; }
/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ public boolean addAll( Collection<? extends E> collection ) { boolean changed = false; int size = collection.size(); ensureCapacity( size ); Iterator<? extends E> it = collection.iterator(); while ( size-- > 0 ) { if ( add( it.next() ) ) { changed = true; } } return changed; }