Пример #1
0
 private DbAnalyzerCorpus sortByFrequency() {
   final MultiMap<Integer, StatementPopulationType> byFrequency =
       new MultiMap<Integer, StatementPopulationType>();
   for (final StatementPopulationType spt : corpus.getPopulation()) {
     byFrequency.put(spt.getFreq(), spt);
   }
   final List<Integer> freqs = new ArrayList<Integer>(byFrequency.keySet());
   Collections.sort(freqs, Collections.reverseOrder());
   corpus.getPopulation().clear();
   for (final Integer i : freqs) {
     final Collection<StatementPopulationType> sub = byFrequency.get(i);
     if ((sub == null) || sub.isEmpty()) {
       continue;
     }
     corpus.getPopulation().addAll(sub);
   }
   return corpus;
 }
Пример #2
0
 public InsertEntry(
     DbAnalyzerCorpus reportObject, String prefix, int colwidth, String kind, String db) {
   this.populationObject = new StatementInsertIntoValuesType();
   this.populationObject.setInsertPrefix(prefix);
   this.populationObject.setKind(kind);
   this.populationObject.setDb(db);
   this.populationObject.setColWidth(colwidth);
   reportObject.getPopulation().add(populationObject);
   byWidth = new HashMap<Integer, InsertTuples>();
 }
Пример #3
0
 public NonInsertEntry(
     DbAnalyzerCorpus reportObject,
     String rep,
     String kind,
     String db,
     int literals,
     DMLCounters incCounter) {
   this.populationObject = new StatementNonInsertType();
   this.populationObject.setStmt(rep);
   this.populationObject.setKind(kind);
   this.populationObject.setDb(db);
   this.populationObject.setLiteralCount(literals);
   reportObject.getPopulation().add(populationObject);
   dmlCategory = incCounter;
 }