Class KeywordFilter


  • public class KeywordFilter
    extends AbstractTaskFilter
    Task filter allowing to filter tasks by keyword.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int RULE_CONTAINS
      Rule requiring given content to be part of task property.
      static int RULE_CONTAINS_NOT
      Rule requiring given content not to be part of task property.
    • Constructor Summary

      Constructors 
      Constructor Description
      KeywordFilter()
      Creates new default keyword filter which is preset to RULE_CONTAINS content rule and no text.
      KeywordFilter​(int contentRule, java.lang.String subString)
      Creates new keyword filter.
    • Field Detail

      • RULE_CONTAINS

        public static final int RULE_CONTAINS
        Rule requiring given content to be part of task property.
        See Also:
        Constant Field Values
      • RULE_CONTAINS_NOT

        public static final int RULE_CONTAINS_NOT
        Rule requiring given content not to be part of task property.
        See Also:
        Constant Field Values
    • Constructor Detail

      • KeywordFilter

        public KeywordFilter​(int contentRule,
                             java.lang.String subString)
        Creates new keyword filter. Filter accepts only RULE_CONTAINS and RULE_CONTAINS_NOT content rules. Other rules will cause that tasks will not be filtered at all.
        Parameters:
        contentRule - One of two content rules determining allowed content in task keyword.
        subString - Text that must/mustn't be present in task keyword.
      • KeywordFilter

        public KeywordFilter()
        Creates new default keyword filter which is preset to RULE_CONTAINS content rule and no text.
    • Method Detail

      • getContentRules

        public java.util.Vector getContentRules()
        Returns both available content rules of keyword filter.
        Overrides:
        getContentRules in class AbstractTaskFilter
        Returns:
        RULE_CONTAINS and RULE_CONTAINS_NOT content rules.
      • filterTasks

        public java.util.Vector filterTasks​(java.util.Vector tasks)
        Applies keyword filter on given tasks and returns those tasks that satisfied filter criterion.
        Overrides:
        filterTasks in class AbstractTaskFilter
        Parameters:
        tasks - Vector of tasks to be filtered.
        Returns:
        Filtered tasks.
      • toString

        public java.lang.String toString()
        Returns name of filter as text.
        Overrides:
        toString in class AbstractTaskFilter
        Returns:
        Name of filter as text.