Package de.japrost.staproma.task
Class DirectoryTask
- java.lang.Object
-
- de.japrost.staproma.task.AbstactTask
-
- de.japrost.staproma.task.DirectoryTask
-
public class DirectoryTask extends AbstactTask
Represents a task which is a directory (so not derived form parsing a file).
A directory has no state of its own but is in all the states that the containing tasks are.- Author:
- alexxismachine (Ulrich David)
-
-
Field Summary
-
Fields inherited from class de.japrost.staproma.task.AbstactTask
state, subTasks
-
-
Constructor Summary
Constructors Constructor Description DirectoryTask(Task parent, java.lang.String path, java.lang.String description)
Create a DirectoryTask with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getPath()
Get the path of the filename.boolean
isInState(TaskState status)
Tell if the task is in the asked status.-
Methods inherited from class de.japrost.staproma.task.AbstactTask
addChild, addContent, getContent, getDescription, getParent, getPriority, hasChildren, iterator, priorities, setPriority, setState
-
-
-
-
Constructor Detail
-
DirectoryTask
public DirectoryTask(Task parent, java.lang.String path, java.lang.String description)
Create a DirectoryTask with the given parameters.- Parameters:
parent
- the parent task.path
- the directory which is represented by this task.description
- the description of the task.
-
-
Method Detail
-
isInState
public boolean isInState(TaskState status)
Tell if the task is in the asked status. A task is in a status if itself or one of the children is in that status. If given status isnull
must returntrue
.This implementation first asks the subtasks if one of them is in the state. If there are no sub tasks returns
true
, so an empty directory is in every state. After that the own state field is compared with the status. If still no match,false
will be returned.- Specified by:
isInState
in interfaceTask
- Overrides:
isInState
in classAbstactTask
- Parameters:
status
- the task state- Returns:
true
if the task is in the asked status.
-
getPath
public java.lang.String getPath()
Get the path of the filename.- Returns:
- the path.
-
-