Package org.cesilko.rachota.core.filters
Class DescriptionFilter
java.lang.Object
org.cesilko.rachota.core.filters.AbstractTaskFilter
org.cesilko.rachota.core.filters.DescriptionFilter
Task filter allowing to filter tasks by description.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Rule requiring given content to be part of task property.static final int
Rule requiring given content not to be part of task property. -
Constructor Summary
ConstructorsConstructorDescriptionCreates new default description filter which is preset to RULE_CONTAINS content rule and no text.DescriptionFilter
(int contentRule, String subString) Creates new description filter. -
Method Summary
Modifier and TypeMethodDescriptionfilterTasks
(Vector tasks) Applies description filter on given tasks and returns those tasks that satisfied filter criterion.Returns both available content rules of description filter.toString()
Returns name of filter as text.Methods inherited from class org.cesilko.rachota.core.filters.AbstractTaskFilter
getContent, getContentRule, getContentValues, setContent, setContentRule
-
Field Details
-
RULE_CONTAINS
public static final int RULE_CONTAINSRule requiring given content to be part of task property.- See Also:
-
RULE_CONTAINS_NOT
public static final int RULE_CONTAINS_NOTRule requiring given content not to be part of task property.- See Also:
-
-
Constructor Details
-
DescriptionFilter
Creates new description 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 description.subString
- Text that must/mustn't be present in task description.
-
DescriptionFilter
public DescriptionFilter()Creates new default description filter which is preset to RULE_CONTAINS content rule and no text.
-
-
Method Details
-
getContentRules
Returns both available content rules of description filter.- Overrides:
getContentRules
in classAbstractTaskFilter
- Returns:
- RULE_CONTAINS and RULE_CONTAINS_NOT content rules.
-
filterTasks
Applies description 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.
-