forked from CS2103AUG2016-T11-C1/main
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Model.java
122 lines (79 loc) · 4.52 KB
/
Model.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package seedu.tasklist.model;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.json.JSONException;
import org.json.simple.parser.ParseException;
import seedu.tasklist.commons.core.UnmodifiableObservableList;
import seedu.tasklist.commons.exceptions.IllegalValueException;
import seedu.tasklist.model.task.EndTime;
import seedu.tasklist.model.task.Priority;
import seedu.tasklist.model.task.ReadOnlyTask;
import seedu.tasklist.model.task.StartTime;
import seedu.tasklist.model.task.Task;
import seedu.tasklist.model.task.TaskDetails;
import seedu.tasklist.model.task.UniqueTaskList;
import seedu.tasklist.model.task.UniqueTaskList.DuplicateTaskException;
import seedu.tasklist.model.task.UniqueTaskList.TaskNotFoundException;
/**
* The API of the Model component.
*/
public interface Model {
/** Clears existing backing model and replaces with the provided new data. */
void resetData(ReadOnlyTaskList newData);
/** Returns the TaskList */
ReadOnlyTaskList getTaskList();
/** Deletes the given task. */
void deleteTask(ReadOnlyTask target) throws UniqueTaskList.TaskNotFoundException;
/** Adds the given task */
void addTask(Task task) throws UniqueTaskList.DuplicateTaskException;
/** Marks the given task as complete */
void markTaskAsComplete(ReadOnlyTask target) throws UniqueTaskList.TaskNotFoundException;
/** Returns the filtered task list as an {@code UnmodifiableObservableList<ReadOnlyPerson>} */
UnmodifiableObservableList<ReadOnlyTask> getFilteredTaskList();
/** Updates the filter of the filtered task list to show all persons */
void updateFilteredListToShowAll();
/** Updates the filter of the filtered task list to filter by the given keywords */
void updateFilteredTaskList(Set<String> keywords);
Set<String> getKeywordsFromList(List<ReadOnlyTask> matchingTasks);
/** Updates the filter of the filtered task list to only show incomplete */
void updateFilteredListToShowIncomplete();
UnmodifiableObservableList<Task> getListOfTasks();
void updateFilteredList();
/** Updates the filter of the filtered task list to only show complete */
void updateFilteredListToShowComplete();
/** Updates the filter of the filtered task list to only certain priority */
public void updateFilteredListToShowPriority(String priority);
/** Updates the filter of the filtered task list to only certain date */
public void updateFilteredListToShowDate(String date);
/** Updates the filter of the filtered task list to only floating tasks */
public void updateFilteredListToShowFloating();
/** Updates the filter of the filtered task list to only overdue tasks */
public void updateFilteredListToShowOverDue();
/** Updates the filter of the filtered task list to only recurring tasks */
public void updateFilteredListToShowRecurring();
void markTaskAsIncomplete(ReadOnlyTask task) throws TaskNotFoundException;
void updateTask(Task taskToUpdate, TaskDetails taskDetails, String startTime, String endTime, Priority priority, String frequency) throws IllegalValueException;
void addTaskUndo(Task task) throws DuplicateTaskException;
void updateTaskUndo(Task taskToUpdate, TaskDetails taskDetails, StartTime startTime, EndTime endTime,
Priority priority, String frequency) throws IllegalValueException;
void deleteTaskUndo(ReadOnlyTask target) throws TaskNotFoundException;
void clearTaskUndo(ArrayList<Task> tasks) throws TaskNotFoundException;
LinkedList<UndoInfo> getUndoStack();
LinkedList<UndoInfo> getRedoStack();
void addToUndoStack(int strCmdId, String currentFilePath, Task... tasks);
void changeFileStorage(String filePath) throws FileNotFoundException, IOException, ParseException, JSONException;
String changeFileStorageUndo(String filePath) throws IOException, ParseException, JSONException;
void deleteTaskRedo(Task task) throws TaskNotFoundException;
void addTaskRedo(Task task) throws DuplicateTaskException;
void markTaskAsCompleteRedo(Task task) throws TaskNotFoundException;
void resetDataRedo(ReadOnlyTaskList emptyTaskList);
void changeFileStorageRedo(String filePath) throws FileNotFoundException, IOException, ParseException, JSONException;
TaskCounter getTaskCounter();
boolean isOverlapping(Task task);
void updateFilteredListToShowOverlapping(Task task);
boolean isDuplicate(Task toAdd);
}