//  Data Structures with Java by John R. Hubbard
//  Copyright McGraw-Hill, 2001
//  Problem 3.5 on page 72

  public int hashCode()
  { int hc = (new Integer(n)).hashCode();
    Widget tw = this.w;
    while (tw != null)
    { hc += (new Integer(tw.n)).hashCode();
      tw = tw.w;
    }
    return hc;
  }
  