Class DurationFilter


  • public class DurationFilter
    extends AbstractTaskFilter
    Task filter allowing to filter tasks by duration.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int RULE_LESS_THAN
      Rule requiring given content NOT to be smaller than task property.
      static int RULE_MORE_THAN
      Rule requiring given content NOT to be greater than task property.
    • Constructor Summary

      Constructors 
      Constructor Description
      DurationFilter()
      Creates new default duration filter which is preset to RULE_MORE_THAN content rule and zero duration.
      DurationFilter​(int contentRule, java.lang.Long duration)
      Creates new duration filter.
    • Field Detail

      • RULE_MORE_THAN

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

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

      • DurationFilter

        public DurationFilter​(int contentRule,
                              java.lang.Long duration)
        Creates new duration filter. Filter accepts only RULE_LESS_THAN and RULE_MORE_THAN 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 duration.
        duration - Time duration in millisecondss that must be greater/smaller than task duration.
      • DurationFilter

        public DurationFilter()
        Creates new default duration filter which is preset to RULE_MORE_THAN content rule and zero duration.
    • Method Detail

      • getContentRules

        public java.util.Vector getContentRules()
        Returns both available content rules of duration filter.
        Overrides:
        getContentRules in class AbstractTaskFilter
        Returns:
        RULE_LESS_THAN and RULE_MORE_THAN content rules.
      • filterTasks

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