Package org.cesilko.rachota.core.filters
Class PriorityFilter
java.lang.Object
org.cesilko.rachota.core.filters.AbstractTaskFilter
org.cesilko.rachota.core.filters.PriorityFilter
Task filter allowing to filter tasks by priority.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Rule requiring given content to be equal to task property.static final int
Rule requiring given content NOT to be greater than task property. -
Constructor Summary
ConstructorsConstructorDescriptionCreates new default priority filter which is preset to RULE_EQUALS content rule and Task.PRIORITY_LOW.PriorityFilter
(int contentRule, Integer priority) Creates new priority filter. -
Method Summary
Modifier and TypeMethodDescriptionfilterTasks
(Vector tasks) Applies priority filter on given tasks and returns those tasks that satisfied filter criterion.Returns required priority value of task.Returns both two available content rules of priority filter.Returns all available content values of priority filter.toString()
Returns name of filter as text.Methods inherited from class org.cesilko.rachota.core.filters.AbstractTaskFilter
getContentRule, setContent, setContentRule
-
Field Details
-
RULE_EQUALS
public static final int RULE_EQUALSRule requiring given content to be equal to task property.- See Also:
-
RULE_EQUALS_NOT
public static final int RULE_EQUALS_NOTRule requiring given content NOT to be greater than task property.- See Also:
-
-
Constructor Details
-
PriorityFilter
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 Details
-
getContentRules
Returns both two available content rules of priority filter.- Overrides:
getContentRules
in classAbstractTaskFilter
- Returns:
- RULE_EQUALS and RULE_EQUALS_NOT content rules.
-
getContentValues
Returns all available content values of priority filter.- Overrides:
getContentValues
in classAbstractTaskFilter
- Returns:
- All content values of priority filter.
-
getContent
Returns required priority value of task.- Overrides:
getContent
in classAbstractTaskFilter
- Returns:
- Required priority value of task.
-
filterTasks
Applies priority filter on given tasks and returns those tasks that satisfied filter criterion.- Overrides:
filterTasks
in classAbstractTaskFilter
- Parameters:
tasks
- Vector of tasks to be filtered.- Returns:
- Filtered tasks.
-
toString
Returns name of filter as text.- Overrides:
toString
in classAbstractTaskFilter
- Returns:
- Name of filter as text.
-