Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some documentation for reference #97

Merged
merged 3 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/tasklist.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"tasks" : [ {
"taskName" : "GAYROME",
"deadlineDate" : "220319",
"deadlineTime" : "2359",
"tagged" : [ ]
}, {
"taskName" : "JEROME",
"deadlineDate" : "230319",
"deadlineTime" : "2359",
Expand Down
174 changes: 151 additions & 23 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,19 @@ image::UndoRedoActivityDiagram.png[width="650"]

// tag::Task[]
=== Task Feature
+This entire section describes comprehensively the technical aspects of the `Task` feature as well
as considerations made during the design of the feature.+


==== `Task` package
+This section describes inner dimensions of the `Task` package.+

===== Reason for implementation

_LIFE_ is a tool for helping students manage their priorities, therefore the ability to help them document their tasks is highly essential.

[Current Implentation of Task]

===== Current Implementation

Each attribute of a Task, such as the task name, date of the deadline,
Expand All @@ -350,6 +356,7 @@ Each of the classes provide utility methods to check the correctness of the stri

The following classes are as such:

.Classes in the `Task` Package
[width="100%", cols="1,2,2", options="header"]
|=======
|Class |Constructor |Remark
Expand All @@ -360,65 +367,186 @@ The following classes are as such:
|Tag|new Tag()|Stores a `String` that acts as a tag to the task. This field is *optional*.
|=======

The `task` package includes the `Task` class which documents information about a task.
The `Task` class provides utility methods to retrieve the different objects (e.g. `DeadlineDate`)

The `Task` package includes the `Task` class which documents information about a task.
The `Task` class provides utility methods to retrieve the different objects (e.g. `DeadlineDate`).
The `Task` class is shown below.

.Table of `Task` Class
[width="100%", cols="1,2,2", options="header"]
|=======
|Class |Constructor |Remark
|Task |`new Task(TaskName, DeadlineDate, DeadlineTime, Tag)` |Stores `TaskName`, `DeadlineDate`,
`DeadlineTime`, `Tag` objects to document a task's information.
|=======

`Task` objects have to be unique. They are considered duplicates
if they share the same TaskName and there is a check for duplicates when adding the task. This check
is found in the `addTaskCommand.java` file which calls for `model` to verify any duplication
before adding the `Task` instance into the `UniqueTaskList`.
{nbsp} +

There is a check for duplicates when adding the task. This check
is found in the `AddTaskCommand.java` file which calls for `model` to verify for any duplication
before adding the `Task` instance into the `UniqueTaskList`.

****
TIP: `_Task_` objects have to be unique and they are considered duplicates if they share the same `_TaskName_`.
****

{nbsp} +

===== Reasons for how it is implemented
The `task` package follows the model of the `person` package which existed before our
team started this project. This made it easier for us to implement our features as we
could follow the style of how the `person` package was implemented thereby
improving the modularity and organization.
team started this project. This was because the `TaskList` was ideated to have the data
stored in a ArrayList like the Addressbook.
This made it easier for us to implement our features as we could reuse the code
and follow the style of how the Addressbook was implemented to made the code
more readable.

//end::Task[]
===== Model

The `TaskList` is a separate feature that is distinct from the other features.
This is done intentionally as the `Life` application is meant to be made up of four
distinct features. Also, this would allow future enhancement of this `TaskList` to include more
functionalities for the `TaskList` such as priority tagging without affecting the
other features due to the low coupling other features have with `Task`.

The following is a model diagram of the `TaskList` component.

.Model Component of `TaskList`.
image::TaskListModelDiagramComponent.png[width='800']

//end::Task[]
{nbsp} +

==== Add Task
The `AddTaskCommand` will create an instance of the `Task` class and store it in the `TaskList`

===== Reason for implementation
To be able to document tasks, students should be able to add their tasks into the application.
To be able to document tasks, students should be able to add their tasks into the application. This will
allow you to view the task in the task list.

===== Current Implementation
The `AddTaskCommand` is created when the command word `addTask` is detected in the user input.
Through the `AddTaskCommand`, the user input will then be split into its separate
components(e.g. `TaskName`, `DeadlineDate`, `DeadlineTime`, `Tag`) through `ParserUtil`,
creating a `Task` instance. This instance is then passed from the `logic` component to the `model` component.
The `AddTaskCommand` is created when the command word `addtask` is detected in the user input alongside
the compulsory parameters as shown in <<Current Implementation of Task>>. If the parameters are invalid, an error
message will be displayed.

Through the `AddTaskCommand`, the user input will then be split into its separate
components(e.g. `TaskName`, `DeadlineDate`, `DeadlineTime`, `Tag`) through `ParserUtil`,
creating a `Task` instance. This instance is then passed from the `logic` component to the `model`
component as shown in <<Add Task Sequence Diagram>>.

==== Model

In the `Model` component, the new `Task` object gets added to the list of tasks into the `UniqueTaskList`.

Given below is an example usage scenario and how the `addTask` mechanism behaves at each step.

Step 1. The user launches the application for the first time.
_LIFE_ will initialize with the initial task list state and the currentStatePointer pointing to that single task li state.

Step 2. The user executes the `addTask` command with `addTask n/Update User Documentation d/301219 e/2359`
Step 2. The user executes the `addtask` command with `addtask n/CS2101 Guides d/140419 h/2359`

Step 3. This command goes through the `AddTaskCommandParser` to extract the values of
the input string and to process it. It also searches for invalid input and duplicates.

Step 4. Once valid, it passes the Task from the `logic` component to the `model` component into an ArrayList called `TaskList`.


The following sequence diagram shows how the `addtask` operation works.

[Add Task Sequence Diagram]
.Add Task Logic Diagram
image::AddTaskSequenceDiagram.png[width="800"]

{nbsp} +

==== Delete Task
The `DeleteTaskCommand` will find and delete the specified `Task` _(that is according to the Task List shown
in the UI)_ from the `TaskList`.

===== Reason for implementation
This `DeleteTaskCommand` is essential if the task is longer needed on the task list. For example,
the user's boss has reassigned the task or the task is no longer valid.

===== Current Implementation
The `DeleteTaskCommand` is created when the command word `deletetask` is detected in the user input alongside
the compulsory parameter which is an index in the `TaskList`. The `DeleteTaskCommand` will then check for the
validity of the index given. If index is invalid, an error message will be displayed.

The following sequence diagram shows how the `deletetask` operation works.

[Delete Task Sequence Diagram]
.Delete Task Sequence Diagram
image::DeleteTaskSequenceDiagram.png[width='800']

{nbsp} +

==== Tick Task
The `TickTaskCommand` will find and delete the specified `Task` _(that is according to the Task List shown
in the UI)_ from the `TaskList` and add them into the `TickedTaskList`.

===== Reason for implementation
Through ticking the tasks that the users have completed and adding them into the
`TickedTaskList` (shown in the UI), the users will feel more motivated to complete more taskx.
This is supported by research that is done by us.

===== Current Implementation
The `TickTaskCommand` is created when the command word `ticktask` is detected in the user input alongside
the compulsory parameter which is an index in the `TaskList`. The `TickTaskCommand` will then check for the
validity of the index given. If index is invalid, an error message will be displayed.

The following sequence diagram shows how the `ticktask` operation works.

[Tick Task Sequence Diagram]
.Tick Task Sequence Diagram
image::TickTaskSequenceDiagram.png[width='800']

{nbsp} +

==== Edit Task
The `EditTaskCommand` will find and edit the specified `Task` _(that is according to the Task List shown
in the UI)_ from the `TaskList` and along with the given input by the user, edit accordingly.

===== Reason for implementation
We believe that this is essential as the user might have entered the wrong details of a task, there
is a change in the deadline of the task, etc. We do not want to inconvenience the user by making him
find the index of the task to be edited, deleting the task and adding the new task.

===== Current Implementation
The `EditTaskCommand` is created when the command word `edittask` is detected in the user input alongside
the compulsory parameter consisting of the index in the `TaskList` and the details to be changed. (e.g. `TaskName,
`DeadlineDate, `DeadlineTime`, `Set<Tag>`)
Like previous commands, The `EditTaskCommand` will also check for the
validity of the index given. If index is invalid, an error message will be displayed.

The following is what makes `EditTask` different from the other `Task` commands.

The `EditTaskCommand` will locate the `Task` to be edited and from it, create a newly edited instance called `editedTask`.
The model will take it both the `Task` to be edited and the `editedTask` and
replace the former `Task` with the `editedTask`.


The following sequence diagram shows how the `edittask` operation works.

[Edit Task Sequence Diagram]
.Edit Task Sequence Diagram
image::EditTaskSequenceDiagram.png[width='800']



==== Alternatives considered
There is consideration for the use of hash map to hold the task list so that
we can easily implement a tag column. However, due to the lack of time and
the presence of already made list functions, we decided to stick with the arraylist
as our team is more familiar with it.
* Alternative 1 (current choice): Create a new Array List Object to store the tasks e.g. `UniqueTaskList`.

** Pros: Array List is the simplest data structure which allows for manipulation of data such as sorting.
Like how the existing `UniquePersonList` was implemented,
We can implement this `UniqueTaskList` in the same way. Therefore, making the overall code more
readable and implementation much simpler.

** Cons : Some operations require the traversing of the list which require O(N) time complexity.
For instance, the `deletetask` command and the checking of duplicates.

* Alternative 2 : Using a Hash Map to store the tasks

** Pros: The `deletetask` command and checking of duplicates has time complexity of O(1).

** Cons: Implementation of Hash Map is a lot more complex than the implemented Array List. At the point
of implementation, My team and I do not
have enough expertise to utilise the Hash Map.



Expand Down
100 changes: 59 additions & 41 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,73 +67,91 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window.
* Items in square brackets are optional e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`.
* Items with `…`​ after them can be used multiple times including zero times e.g. `[t/TAG]...` can be used as `{nbsp}` (i.e. 0 times), `t/friend`, `t/friend t/family` etc.
* Parameters can be in any order e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable.
* Items in square brackets are optional e.g n/NAME [d/DEADLINE_DATE] can be used as n/CS2113 User Guide d/030919 or as n/CS2113 User Guide.
====

=== Task List
A feature to help you record your tasks at hand with the deadlines, say no more to procrastination! +
A feature to help you record your tasks with deadlines, say no more to forgetting your tasks! +

==== Adding a Task : `addTask`
The following subsections are commands of the task list.

Adds a task to the daily list. +
Format: `addTask n/TAK d/DEADLINE_DATE h/DEADLINE_TIME`
==== Adding a Task : `addtask`

****
Words in `UPPER_CASE` are the parameters. +
All fields are compulsory +
TASK contains the name of the TASK +
DEADLINE_DATE should be in the DDMMYY format +
DEADLINE_TIME should be in 24HRS
The first step to managing your tasks is to *add* them into the task list! +
Format: `addtask n/TASK_NAME d/DEADLINE_DATE h/DEADLINE_TIME [t/TAGS]`

****
* _TASK_NAME_ is the name of the task that you want to input {nbsp}
* _DEADLINE_DATE_ is the date of the deadline of the task in _DDMMYY_ format. {nbsp} +
* _DEADLINE_TIME_ is the time of the deadline of the task in _24HRS_ format {nbsp} +
****

[TIP]
_Tags_ are optional and are alphanumeric without space

The following are examples of some commands that you can try out:

* `addtask n/Complete CS2113T Assignment d/180319 h/2359`
* `addtask n/Submit Exchange Application d/200319 h/0800 t/IMPORTANT`

==== Delete Task : `deletetask`

In case the task is no longer required, you can *delete* it off the task list by specifying the index of
the task you want to delete! +
Format: `deletetask INDEX`

[TIP]
The index is the integer on the left side of the Task Name in the Task List that you want to *delete*!

[WARNING]
The index must be a valid index in the task list and it must be present.

Examples:

* `addTask n/Complete CS2113T Assignment d/180319 h/2359`
* `addTask n/Submit Exchange Application d/200319 h/0800`
==== Delete Task : `deleteTask`
* `deletetask 5` +
_Deletes the task at index 5_

==== Edit Task : `edittask`
In case you want to change the details of a task, you can *edit* it through specifying the index of the task
as well as the information you want to edit. +
Format: `edittask 1 [n/TASK_NAME] [d/DEADLINE_DATE] [h/DEADLINE_TIME]`

Deletes the specified item off the Task List. +
Format: `deleteTask INDEX`
[WARNING]
The index must be a valid index in the task list and it must be present. +
At least one optional field must be provided.

****
Words in `UPPER_CASE` are the parameters.
Deletes the item at the specified `INDEX`. +
The `INDEX` can be found just by looking at the INDEX of the task displayed in the GUI +
The `INDEX` must be a positive integer 1,2,3 ...
* Existing values will be replaced with the input values +
* DEADLINE_DATE is the deadline date of the task and should be in the DDMMYY format +
* DEADLINE_TIME is the deadline time of the task and should be in the 24HRS format
****

Examples:

* `deleteTask 5` +
Deletes the task at INDEX 5
* `edittask 2 n/Banana` +
_Changes the task name of the task specified at index 2 to Banana._

==== Edit Task : `editTask`
Edits an existing specified task on the Task List. +
Format: `editTask 1 [n/TASK_NAME] [d/DEADLINE_DATE] [h/DEADLINE_TIME]`
* `edittask 2 d/290319` +
_Change sthe deadline date of the task specified at index 2 to 290319._

****
Words in `UPPER_CASE` are the parameters.
Edits the task at the specified INDEX. +
The index needs to be provided +
At least one of the optional fields must be provied +
Existing values will be replaced with the input values +
DEADLINE_DATE should be in the DDMMYY format +
DEADLINE_TIME should be in the 24HRS format
****
==== Tick Task : `ticktask`

*Ticks* off the task that you have completed off the task list and adds it into the completed task list! +
Format: `ticktask` INDEX

[WARNING]
The index must be a valid index in the task list and it must be present. +
Once the application restarts, all the data in the Completed Task List will be gone.

Examples:

* `editTask 2 n/Banana` +
Change the task name of the task specified at INDEX 2 to Banana.
* `ticktask 5` +
_Ticks the task at index 5 off._

* `editTask 2 d/290319` +
Change the deadline date of the task specified at INDEX 2 to 300219.
==== Sort Task List : `sorttask`
Helps you to *sort* the tasks in the task list according to their deadline with upcoming deadlines first! +
Format: `sorttask`

==== Clear Task : `clearTask` [coming soon]

Clears off all the tasks from the Task List. +
Format: `clearTask`

=== Expenditure List
A list to help you keep track of all your expenses so that you can better manage your finances! +
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
</padding>
</StackPane>
</SplitPane>

<StackPane fx:id="statusbarPlaceholder" VBox.vgrow="NEVER" />
</VBox>
</Scene>
Expand Down