Class PriorityFilter


  • public class PriorityFilter
    extends AbstractTaskFilter
    Task filter allowing to filter tasks by priority.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int RULE_EQUALS
      Rule requiring given content to be equal to task property.
      static int RULE_EQUALS_NOT
      Rule requiring given content NOT to be greater than task property.
    • Constructor Summary

      Constructors 
      Constructor Description
      PriorityFilter()
      Creates new default priority filter which is preset to RULE_EQUALS content rule and Task.PRIORITY_LOW.
      PriorityFilter​(int contentRule, java.lang.Integer priority)
      Creates new priority filter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Vector filterTasks​(java.util.Vector tasks)
      Applies priority filter on given tasks and returns those tasks that satisfied filter criterion.
      java.lang.String getContent()
      Returns required priority value of task.
      java.util.Vector getContentRules()
      Returns both two available content rules of priority filter.
      java.util.Vector getContentValues()
      Returns all available content values of priority filter.
      java.lang.String toString()
      Returns name of filter as text.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • RULE_EQUALS

        public static final int RULE_EQUALS
        Rule requiring given content to be equal to task property.
        See Also:
        Constant Field Values
      • RULE_EQUALS_NOT

        public static final int RULE_EQUALS_NOT
        Rule requiring given content NOT to be greater than task property.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PriorityFilter

        public PriorityFilter​(int contentRule,
                              java.lang.Integer priority)
        Creates new priority filter. Filter accepts only RULE_EQUALS and RULE_EQUALS_NOT content rules. Other rules will cause that tasks will not be filtered at all.
        Parameters:
        contentRule - One of two content rules determining allowed value of task priority.
        priority - Priority level that must be equal/different than task priority.
      • PriorityFilter

        public PriorityFilter()
        Creates new default priority filter which is preset to RULE_EQUALS content rule and Task.PRIORITY_LOW.
    • Method Detail

      • getContentRules

        public java.util.Vector getContentRules()
        Returns both two available content rules of priority filter.
        Overrides:
        getContentRules in class AbstractTaskFilter
        Returns:
        RULE_EQUALS and RULE_EQUALS_NOT content rules.
      • getContentValues

        public java.util.Vector getContentValues()
        Returns all available content values of priority filter.
        Overrides:
        getContentValues in class AbstractTaskFilter
        Returns:
        All content values of priority filter.
      • getContent

        public java.lang.String getContent()
        Returns required priority value of task.
        Overrides:
        getContent in class AbstractTaskFilter
        Returns:
        Required priority value of task.
      • filterTasks

        public java.util.Vector filterTasks​(java.util.Vector tasks)
        Applies priority 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.