Пример #1
0
 /** Prints the total number of each report type reported by this object. */
 public void reportTotals() {
   StringBuffer sbuf = new StringBuffer();
   sbuf.append("Totals: ");
   ReportType[] types = typeList_.toArray(new ReportType[0]);
   Arrays.sort(types);
   for (int i = 0; i < types.length; i++) {
     ReportType type = types[i];
     if (i > 0) {
       sbuf.append("; ");
     }
     sbuf.append(type.getNames()).append(": ").append(typeMap_.getCount(type));
   }
   println(sbuf.toString());
 }
Пример #2
0
 /**
  * Writes to the output stream a summary of messages which were suppressed in a given stage
  * because the maximum repeat count was exceeded.
  *
  * @param scode section code to summarise
  */
 public void summariseUnreportedMessages(String scode) {
   String dscode = "-" + scode + "-";
   int lds = dscode.length();
   for (Iterator<String> it = codeMap_.keySet().iterator(); it.hasNext(); ) {
     String ecode = it.next();
     if (dscode.equals(ecode.substring(1, 1 + lds))) {
       int count = codeMap_.getCount(ecode);
       if (count > maxRepeat_) {
         println(ecode + "-" + countXx_ + " (" + (count - maxRepeat_) + " more)");
       }
       it.remove();
     }
   }
 }
Пример #3
0
 /**
  * Provides a summary of any message types which were not reported.
  *
  * @param code message code for this summary
  * @param types array of types to report on, or null for all types
  */
 public void summariseUnreportedTypes(String code, ReportType[] types) {
   if (types == null) {
     types = typeMap_.keySet().toArray(new ReportType[0]);
   }
   StringBuffer sbuf = new StringBuffer();
   for (int it = 0; it < types.length; it++) {
     ReportType type = types[it];
     if (it > 0) {
       sbuf.append(", ");
     }
     sbuf.append(type.toString()).append(": ").append(typeMap_.getCount(type));
   }
   report(ReportType.SUMMARY, code, sbuf.toString());
 }