public String prettyPrint(){
  final StringBuffer sb=new StringBuffer(shortSummary());
  sb.append('\n');
  if (!this.keepTaskList) {
    sb.append("No task info kept");
  }
 else {
    final TaskInfo[] tasks=getTaskInfo();
    sb.append("-----------------------------------------\n");
    sb.append("ms     %     Task name\n");
    sb.append("-----------------------------------------\n");
    final NumberFormat nf=NumberFormat.getNumberInstance();
    nf.setMinimumIntegerDigits(5);
    nf.setGroupingUsed(false);
    final NumberFormat pf=NumberFormat.getPercentInstance();
    pf.setMinimumIntegerDigits(3);
    pf.setGroupingUsed(false);
    for (    final TaskInfo task : tasks) {
      sb.append(nf.format(task.getTimeMillis()) + "  ");
      final double totalTimeSeconds=getTotalTimeSeconds();
      final double percentage=totalTimeSeconds == 0 ? 0 : task.getTimeSeconds() / totalTimeSeconds;
      sb.append(pf.format(percentage) + "  ");
      sb.append(task.getTaskName() + "\n");
    }
  }
  return sb.toString();
}

public String prettyPrint ( ) { final StringBuffer sb = new StringBuffer ( shortSummary ( ) ) ; sb . append ( '\n' ) ; if ( ! this . keepTaskList ) { sb . append ( "No task info kept" ) ; } else { final TaskInfo [ ] tasks = getTaskInfo ( ) ; sb . append ( "-----------------------------------------\n" ) ; sb . append ( "ms     %     Task name\n" ) ; sb . append ( "-----------------------------------------\n" ) ; final NumberFormat nf = NumberFormat . getNumberInstance ( ) ; nf . setMinimumIntegerDigits ( 5 ) ; nf . setGroupingUsed ( false ) ; final NumberFormat pf = NumberFormat . getPercentInstance ( ) ; pf . setMinimumIntegerDigits ( 3 ) ; pf . setGroupingUsed ( false ) ; for ( final TaskInfo task : tasks ) { sb . append ( nf . format ( task . getTimeMillis ( ) ) + "  " ) ; final double totalTimeSeconds = getTotalTimeSeconds ( ) ; final double percentage = totalTimeSeconds == 0 ? 0 : task . getTimeSeconds ( ) / totalTimeSeconds ; sb . append ( pf . format ( percentage ) + "  " ) ; sb . append ( task . getTaskName ( ) + "\n" ) ; } } return sb . toString ( ) ; }
return a string with a table describing all tasks performed . for custom reporting , call gettaskinfo ( ) and use the task info directly .
