//  Data Structures with Java by John R. Hubbard
//  Copyright McGraw-Hill, 2001
//  Problem 5.7 on page 107

  public int hashCode()
  { // returns a hash code for this bag that is the sum
    // of the hash codes of its elements
    int code=0;
    for (int i=0; i<size; i++)
      code += objects[i].hashCode();
    return code;
  }
