code: public void updateHeads(HeadRules rules) {
      if (parts != null && parts.size() != 0) {
        for (int pi=0,pn=parts.size();pi<pn;pi++) {
          Parse c = (Parse) parts.get(pi);
          c.updateHeads(rules);
        }
        this.head = rules.getHead((Parse[]) parts.toArray(new Parse[parts.size()]), type);
        if (head == null) {
          head = this;
        }
      }
      else {
        this.head = this;
      }
    }
docs: Computes the head parses for this parse and its sub-parses and stores this information
  in the parse data structure.
  @param rules The head rules which determine how the head of the parse is computed.