public void addAlgorithm(IScoredScan scan) { String key = scan.getAlgorithm(); if (m_Scores.containsKey(key)) { throw new IllegalStateException("duplicate algorithm " + key); } else { m_Scores.put(key, scan); } }
/** * combine two scores * * @param added */ public void addTo(IMultiScorer added) { IScoredScan[] scoredScans = added.getScoredScans(); for (int i = 0; i < scoredScans.length; i++) { IScoredScan addedScan = scoredScans[i]; IScoredScan current = getScoredScan(addedScan.getAlgorithm()); if (current == null) addAlgorithm(addedScan); else ((ScoredScan) current).addTo(addedScan); } }