/**
   * Dumps the profile data.
   *
   * @param buffer The string buffer
   * @param time The time
   */
  protected void dump(StringBuffer buffer, long time) {
    Collection<FrameNode> frameNodes = rootFrames.values();
    if (frameNodes.size() == 0) {
      return;
    }

    buffer.append("\t<thread name=\"").append(thread).append("\">\n");
    for (FrameNode frameNode : frameNodes) {
      frameNode.dump(buffer, time, 2);
    }
    buffer.append("\t</thread>\n");
  }
  /**
   * Dumps into a dump file.
   *
   * @param writer The writer
   * @param time The time
   */
  protected void dump(PrintWriter writer, long time) {
    Collection<FrameNode> frameNodes = rootFrames.values();
    if (frameNodes.size() == 0) {
      return;
    }

    writer.printf("\t<thread name=\"%s\">", thread);
    writer.println("");
    for (FrameNode frameNode : frameNodes) {
      frameNode.dump(writer, time, 2);
    }
    writer.println("\t</thread>");
  }