예제 #1
0
    public static void printViewPatterns() {
      processedViewsForPatterns = new HashSet<ViewTrace>();
      HashMap<String, Integer> viewPatterns = new HashMap<String, Integer>();

      ps.println("ViewPatterns ------------------- \n");
      for (ViewTrace trace : viewsRegistry) {
        if (processedViewsForPatterns.contains(trace)) {
          continue;
        }
        ViewTrace v = trace.getRootView();
        StringBuilder p = new StringBuilder();
        p.append("PATTERN ");
        extractViewPattern(0, v, p);
        p.append("\n");
        String pattern = p.toString();
        Integer count = viewPatterns.get(pattern);
        if (count == null) {
          viewPatterns.put(pattern, 1);
        } else {
          viewPatterns.put(pattern, count + 1);
        }
      }
      processedViewsForPatterns = null;
      for (Map.Entry<String, Integer> e : viewPatterns.entrySet()) {
        ps.print("(" + e.getValue() + ") ");
        ps.println(e.getKey());
      }
    }
예제 #2
0
 public static void printIndividualViews() {
   printedIndividualViews = new HashSet<ViewTrace>();
   ps.println("Individual views statistics ------------------- \n");
   for (ViewTrace trace : viewsRegistry) {
     if (printedIndividualViews.contains(trace)) {
       continue;
     }
     ViewTrace v = trace.getRootView();
     ps.print("ROOT ");
     dumpView(0, v);
     ps.println();
   }
   printViewPatterns();
   printedIndividualViews = null;
 }