Exemplo n.º 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());
      }
    }
Exemplo n.º 2
0
 public static void printSite(Site s) {
   StringBuilder b = new StringBuilder();
   printSite(s, b);
   ps.println(b.toString());
 }