Package org.cesilko.rachota.core.filters
Class IdleFilter
- java.lang.Object
-
- org.cesilko.rachota.core.filters.AbstractTaskFilter
-
- org.cesilko.rachota.core.filters.IdleFilter
-
public class IdleFilter extends AbstractTaskFilter
Task filter allowing to filter idle tasks.
-
-
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 IdleFilter()
Creates new default private filter which is preset to RULE_EQUALS content rule and Boolean.TRUE.IdleFilter(int contentRule, java.lang.Boolean idleProperty)
Creates new idle filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Vector
filterTasks(java.util.Vector tasks)
Applies idle filter on given tasks and returns those tasks that satisfied filter criterion.java.lang.String
getContent()
Returns required idle property of task.java.util.Vector
getContentRules()
Returns both two available content rules of idle filter.java.util.Vector
getContentValues()
Returns all available content values of idle filter.java.lang.String
toString()
Returns name of filter as text.-
Methods inherited from class org.cesilko.rachota.core.filters.AbstractTaskFilter
getContentRule, setContent, setContentRule
-
-
-
-
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
-
IdleFilter
public IdleFilter(int contentRule, java.lang.Boolean idleProperty)
Creates new idle 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 private property of task.idleProperty
- Required value of task private property.
-
IdleFilter
public IdleFilter()
Creates new default private filter which is preset to RULE_EQUALS content rule and Boolean.TRUE.
-
-
Method Detail
-
getContentRules
public java.util.Vector getContentRules()
Returns both two available content rules of idle filter.- Overrides:
getContentRules
in classAbstractTaskFilter
- Returns:
- RULE_EQUALS and RULE_EQUALS_NOT content rules.
-
getContentValues
public java.util.Vector getContentValues()
Returns all available content values of idle filter.- Overrides:
getContentValues
in classAbstractTaskFilter
- Returns:
- All content values of idle filter.
-
getContent
public java.lang.String getContent()
Returns required idle property of task.- Overrides:
getContent
in classAbstractTaskFilter
- Returns:
- Required idle property of task.
-
filterTasks
public java.util.Vector filterTasks(java.util.Vector tasks)
Applies idle 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
public java.lang.String toString()
Returns name of filter as text.- Overrides:
toString
in classAbstractTaskFilter
- Returns:
- Name of filter as text.
-
-