Class 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 Detail

      • CheckStats

        public CheckStats()
    • Method Detail

      • clear

        public void clear()
        Clears all accumulated data.
      • add

        public void add​(I item,
                        RuleId ruleId,
                        CheckResult result)
        Accumulate data on an item.
        Parameters:
        item - The checked or ignored item.
        ruleId - The RuleId of the passed or ignored Rule.
        result - The obtained CheckResult.
      • getItems

        public Set<I> getItems()
        Returns:
        A Set of all items that were accumulated.
      • getRuleIds

        public Set<RuleId> getRuleIds()
        Returns:
        A Set of all RuleIds that were accumulated.
      • getRuleIds

        public Set<RuleId> getRuleIds​(I item,
                                      CheckResult result)
        Return a Set of all RuleIds that were accumulated for a given item with a certain CheckResult.
        Parameters:
        item - The item.
        result - The CheckResult.
        Returns:
        A Set of all RuleIds that were accumulated for item with a result.
      • getCounts

        public int getCounts​(RuleId ruleId,
                             CheckResult result)
        Return the number of entries that were accumulated for a given RuleId with a certain CheckResult.
        Parameters:
        ruleId - The RuleId.
        result - The CheckResult.
        Returns:
        The number of entries that were accumulated for ruleId with result.
      • getCounts

        public int getCounts​(RuleId ruleId)
        Return the number of entries that were accumulated for a given RuleId.
        Parameters:
        ruleId - The RuleId.
        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 given CheckResult.
        Parameters:
        result - The CheckResult.
        Returns:
        The number of entries that were accumulated for a result.
      • getCounts

        public int getCounts()
        Returns:
        The number of entries that were accumulated.