Package org.cesilko.rachota.core
Class RegularTask
java.lang.Object
org.cesilko.rachota.core.Task
org.cesilko.rachota.core.RegularTask
- All Implemented Interfaces:
ClockListener
Task that repeats every day or once a week.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
Type of repetition this regular task represents.static int
Regular task that repeats every day.static int
Regular task that repeats every Friday.static int
Regular task that repeats every Monday.static int
Regular task that repeats every Saturday.static int
Regular task that repeats every Sunday.static int
Regular task that repeats every Thursday.static int
Regular task that repeats every Tuesday.static int
Regular task that repeats every Wednesday.static int
Regular task that repeats every weekend day.static int
Regular task that repeats every working day.Fields inherited from class org.cesilko.rachota.core.Task
PRIORITY_HIGH, PRIORITY_LOW, PRIORITY_MEDIUM, STATE_DONE, STATE_NEW, STATE_STARTED
-
Constructor Summary
ConstructorsConstructorDescriptionRegularTask
(String description, String keyword, String notes, int priority, int state, long duration, Date notificationTime, boolean automaticStart, boolean privateTask, int frequency) Creates a new instance of regular task. -
Method Summary
Modifier and TypeMethodDescriptionReturns clone of itself with time set to 0 and state set to STATE_NEW.int
Returns how often task is repeated.static String
getFrequency
(int frequency) Returns how often task is repeated.boolean
isPlannedFor
(Day day) Verifies if task is planned for given day.void
setFrequency
(int frequency) Sets how often task is repeated.void
writeRepetition
(PrintStream stream) Writes information about repetition of task.Methods inherited from class org.cesilko.rachota.core.Task
addDuration, addNote, addPropertyChangeListener, automaticStart, compare, getDescription, getDuration, getKeyword, getKeywordIterator, getNotes, getNotificationTime, getPriority, getPriority, getState, getState, isIdleTask, isRunning, privateTask, removePropertyChangeListener, setAutomaticStart, setDescription, setDuration, setKeyword, setNotes, setNotificationTime, setPriority, setPrivateTask, setState, startWork, suspendWork, tick, toString, workDone, write
-
Field Details
-
frequency
private int frequencyType of repetition this regular task represents. -
FREQUENCY_DAILY
public static int FREQUENCY_DAILYRegular task that repeats every day. -
FREQUENCY_MONDAY
public static int FREQUENCY_MONDAYRegular task that repeats every Monday. -
FREQUENCY_TUESDAY
public static int FREQUENCY_TUESDAYRegular task that repeats every Tuesday. -
FREQUENCY_WEDNESDAY
public static int FREQUENCY_WEDNESDAYRegular task that repeats every Wednesday. -
FREQUENCY_THURSDAY
public static int FREQUENCY_THURSDAYRegular task that repeats every Thursday. -
FREQUENCY_FRIDAY
public static int FREQUENCY_FRIDAYRegular task that repeats every Friday. -
FREQUENCY_SATURDAY
public static int FREQUENCY_SATURDAYRegular task that repeats every Saturday. -
FREQUENCY_SUNDAY
public static int FREQUENCY_SUNDAYRegular task that repeats every Sunday. -
FREQUENCY_WORKDAY
public static int FREQUENCY_WORKDAYRegular task that repeats every working day. -
FREQUENCY_WEEKEND
public static int FREQUENCY_WEEKENDRegular task that repeats every weekend day.
-
-
Constructor Details
-
RegularTask
public RegularTask(String description, String keyword, String notes, int priority, int state, long duration, Date notificationTime, boolean automaticStart, boolean privateTask, int frequency) Creates a new instance of regular task.- Parameters:
description
- Description of task.keyword
- Arbitrary text for grouping tasks etc.notes
- Notes of task.priority
- Priority of task.state
- State of progress of task.duration
- Time in ms that was already spent on task.notificationTime
- Time when system should warn about task.automaticStart
- Should system switch to task automatically ?privateTask
- Is this task private ?frequency
- Frequency of task's repetitions.
-
-
Method Details
-
setFrequency
public void setFrequency(int frequency) Sets how often task is repeated.- Parameters:
frequency
- Frequency of task's repetitions.
-
getFrequency
public int getFrequency()Returns how often task is repeated.- Returns:
- Frequency of task's repetitions.
-
getFrequency
Returns how often task is repeated.- Parameters:
frequency
- Frequency of task's repetitions as number.- Returns:
- Frequency of task's repetitions as text.
-
writeRepetition
Writes information about repetition of task.- Overrides:
writeRepetition
in classTask
- Parameters:
stream
- Print stream where repetition info will be written.- Throws:
IOException
- Input/output exception thrown when some error during writing repetition information occurs.
-
isPlannedFor
Verifies if task is planned for given day.- Parameters:
day
- Day to be checked.- Returns:
- True if task suits for given day, false otherwise.
-
cloneTask
Returns clone of itself with time set to 0 and state set to STATE_NEW.
-