//  Data Structures with Java by John R. Hubbard
//  Copyright McGraw-Hill, 2001
//  Problem 5.3 on page 106

  public boolean addAll(Collection collection)
  { // adds all the objects in the given collection
    // to this bag
    resize(2*collection.size());
    for (Iterator it = collection.iterator(); it.hasNext(); )
      objects[size++] = it.next();
    return true;
  }
  