Пример #1
0
 /** @return */
 public Map<QueryType, Integer> getQueryCounts() {
   Map<QueryType, Integer> query_counts = new HashMap<QueryType, Integer>();
   for (QueryType type : QueryType.values()) {
     query_counts.put(type, 0);
   } // FOR
   for (Statement catalog_stmt : this.catalog_stmts) {
     QueryType type = QueryType.get(catalog_stmt.getQuerytype());
     query_counts.put(type, query_counts.get(type) + 1);
   } // FOR
   return (query_counts);
 }
Пример #2
0
 /**
  * @param element0
  * @param element1
  * @param comparison_exp
  * @param catalog_stmts
  * @return
  */
 public boolean add(
     CatalogType element0,
     CatalogType element1,
     ExpressionType comparison_exp,
     Collection<Statement> catalog_stmts) {
   Set<QueryType> query_types = new HashSet<QueryType>();
   for (Statement catalog_stmt : catalog_stmts) {
     query_types.add(QueryType.get(catalog_stmt.getQuerytype()));
   } // FOR
   boolean ret = this.add(CatalogPair.factory(element0, element1, comparison_exp, query_types));
   if (ret) this.catalog_stmts.addAll(catalog_stmts);
   return (ret);
 }