Package cdc.issues.stats
Class CheckStats<I>
- java.lang.Object
-
- cdc.issues.stats.CheckStats<I>
-
- Type Parameters:
I- The item type, onto which rules are passed or skipped.
public class CheckStats<I> extends Object
Utility designed to accumulate statistics on passed and ignored checks on items.- Author:
- Damien Carbonne
-
-
Constructor Summary
Constructors Constructor Description CheckStats()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(I item, RuleId ruleId, CheckResult result)Accumulate data on anitem.voidclear()Clears all accumulated data.intgetCounts()intgetCounts(RuleId ruleId)Return the number of entries that were accumulated for a givenRuleId.intgetCounts(RuleId ruleId, CheckResult result)Return the number of entries that were accumulated for a givenRuleIdwith a certainCheckResult.intgetCounts(CheckResult result)Return the number of entries that were accumulated for a givenCheckResult.Set<I>getItems()Set<RuleId>getRuleIds()Set<RuleId>getRuleIds(I item, CheckResult result)
-
-
-
Method Detail
-
clear
public void clear()
Clears all accumulated data.
-
add
public void add(I item, RuleId ruleId, CheckResult result)
Accumulate data on anitem.- Parameters:
item- The checked or ignored item.ruleId- TheRuleIdof the passed or ignoredRule.result- The obtainedCheckResult.
-
getRuleIds
public Set<RuleId> getRuleIds(I item, CheckResult result)
- Parameters:
item- The item.result- TheCheckResult.- Returns:
- A Set of all
RuleIdsthat were accumulated foritemwith aresult.
-
getCounts
public int getCounts(RuleId ruleId, CheckResult result)
Return the number of entries that were accumulated for a givenRuleIdwith a certainCheckResult.- Parameters:
ruleId- TheRuleId.result- TheCheckResult.- Returns:
- The number of entries that were accumulated for
ruleIdwithresult.
-
getCounts
public int getCounts(RuleId ruleId)
Return the number of entries that were accumulated for a givenRuleId.- Parameters:
ruleId- TheRuleId.- Returns:
- The number of entries that were accumulated for
ruleId.
-
getCounts
public int getCounts(CheckResult result)
Return the number of entries that were accumulated for a givenCheckResult.- Parameters:
result- TheCheckResult.- Returns:
- The number of entries that were accumulated for a
result.
-
getCounts
public int getCounts()
- Returns:
- The number of entries that were accumulated.
-
-