HashMap filterMap = new HashMap();
// Map statistics
for (int i = 0; i < stats.length; ++i) {
Statistic s = stats[i];
statistics.put(s.getName(), s);
Calculator c = factory.createCalculator(s.getCalculator(), s);
calculators.put(s.getName(), c);
// Map filters by regexpression
// to ensure we only match on a given
// expression once
String matchExp = s.getFirst().getMatch();
FilterStatisticMap f = (FilterStatisticMap) filterMap.get(matchExp);
if (f == null) {
f = new FilterStatisticMap(matchExp);
filterMap.put(matchExp, f);
}
f.getFirsts().add(s);
if (s.getSecond() != null) {
matchExp = s.getSecond().getMatch();
f = (FilterStatisticMap) filterMap.get(matchExp);
if (f == null) {
f = new FilterStatisticMap(matchExp);
filterMap.put(matchExp, f);
}