-
Notifications
You must be signed in to change notification settings - Fork 102
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
[Ho Wei Yi Stanley] iP #99
Open
beaniestanley
wants to merge
28
commits into
nus-cs2113-AY2021S2:master
Choose a base branch
from
beaniestanley:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
d8b5029
Added Level-0: Greet.
beaniestanley a710370
Added Level-1: Greet, Echo, Exit
beaniestanley 9e06de3
Debug
beaniestanley 53e4366
Added Level-2: Add, List
beaniestanley f696b11
Added Level-1: Greet, Echo, Exit
beaniestanley 0826396
Merge remote-tracking branch 'origin/master'
beaniestanley 236e379
Add Level-3 and comply with coding standard
beaniestanley 79b8ee9
Comply to coding standards
beaniestanley dee65dc
Add Level-4: ToDos, Events, Deadlines
beaniestanley 6caaaf4
Add text files for semi-automated test
beaniestanley e61fbcb
Edit comment and check code quality
beaniestanley 5007ced
Improve coding standard based on comments
beaniestanley 9c4ca50
Edit expected output file for UI testing
beaniestanley d6f5511
Add error handling and improve code quality
beaniestanley c5a16a8
Added Class package
beaniestanley 9eaf478
Add Class package
beaniestanley 9d57036
Add Level-6: Delete
beaniestanley 28bda25
Add Level-7: Save
beaniestanley b9e4e31
Add test file
beaniestanley 32f8268
Merge branch 'branch-Level-7'
beaniestanley 6c55cb6
Add Level-9: Find
beaniestanley a0cd9a9
Merge pull request #1 from beaniestanley/branch-Level-9
beaniestanley 8a4f674
Add javadocs
beaniestanley d1f6497
Merge remote-tracking branch 'origin/master'
beaniestanley 46d5543
Add javadocs for find method
beaniestanley 80b1963
Debug and add UG draft
beaniestanley 7b7abd2
Add Release v0.2 link
beaniestanley 459f62f
Set theme jekyll-theme-cayman
beaniestanley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,154 @@ | ||
# User Guide | ||
|
||
## Features | ||
Welcome! Come and plan your tasks with Duke! :) | ||
|
||
### Feature 1 | ||
Description of feature. | ||
#### Types of tasks: | ||
|
||
## Usage | ||
1. ToDo | ||
2. Event | ||
3. Deadline | ||
|
||
### `Keyword` - Describe action | ||
* [Quick Start](#quick-Start) | ||
* [Features](#features) | ||
* [List all Tasks : `list`](#list-all-tasks--list) | ||
* [Add Todo : `todo`](#add-todo--todo) | ||
* [Add Event : `event`](#add-event--event) | ||
* [Add Deadline : `deadline`](#add-deadline--deadline) | ||
* [Delete Task : `delete`](#delete-task--delete) | ||
* [Mark Task as Done : `done`](#mark-task-as-done--done) | ||
* [Find by Keyword : `find`](#find-by-keyword--find) | ||
* [Exit : `bye`](#exit--bye) | ||
* [Command Summary](#command-summary) | ||
|
||
Describe action and its outcome. | ||
| ||
|
||
Example of usage: | ||
## Quick Start | ||
|
||
`keyword (optional arguments)` | ||
Download `Duke.jar` from | ||
here: https://github.com/beaniestanley/ip/releases/tag/A-Release | ||
|
||
Expected outcome: | ||
**Requirements:** | ||
|
||
`outcome` | ||
Ensure you have Java 11 or above installed. | ||
|
||
**Usage:** | ||
|
||
1. Store the .jar file in a folder | ||
2. Run the .jar file | ||
3. Enter your command! | ||
|
||
| ||
|
||
## Features | ||
|
||
### List all Tasks : `list` | ||
|
||
Displays all the tasks currently in your task list. | ||
|
||
> `[T]` Todo<br> | ||
> `[E]` Event<br> | ||
> `[D]` Deadline<br> | ||
|
||
> `[X]` Done<br> | ||
> `[ ]` Not done | ||
|
||
**Format:** `list` | ||
|
||
| | Example | | ||
| --------- | ------------------------------------------------------- | | ||
| Input | `list` | | ||
| Output | `Here are the tasks in your list: ` <br>`1.[T][ ] Exercise`<br>`2.[E][X] Meet friends (at: May 22nd 5pm)`<br>`3.[D][ ] Watch lecture (by: Sunday 3pm)` | | ||
|
||
| ||
|
||
### Add ToDo : `todo` | ||
|
||
Adds a Todo with description.<br> | ||
**Format:** `todo <description>` | ||
|
||
| | Example | | ||
| --------- | ------------------------------------------------------- | | ||
| Input | `todo eat apple` | | ||
| Output | `Got it. I've added this task:`<br>`[T][ ] eat apple`<br>`Now you have 4 tasks in the list.` | | ||
|
||
| ||
|
||
### Add Event : `event` | ||
|
||
Adds an event with description and datetime.<br> | ||
**Format:** `event <description> /at <datetime>` | ||
|
||
| | Example | | ||
| --------- | ------------------------------------------------------- | | ||
| Input | `Celebrate May's birthday /at 05/06/2021 1900` | | ||
| Output | `Got it. I've added this task:`<br>`[E][ ] party (at: 05/06/2021 1900)`<br>`Now you have 5 tasks in the list.` |` | ||
|
||
| ||
|
||
### Add Deadline : `deadline` | ||
|
||
Adds a deadline with description and datetime.<br> | ||
**Format:** `deadline <description> /by <datetime>` | ||
|
||
| | Example | | ||
| --------- | ------------------------------------------------------- | | ||
| Input | `deadline Finish iP /by Sunday 3pm` | | ||
| Output | `Got it. I've added this task:`<br>`[D][ ] Finish iP (by: Sunday 3pm)`<br>`Now you have 6 tasks in the list.` | | ||
|
||
| ||
|
||
### Delete Task : `delete` | ||
|
||
Deletes a task using specified index.<br> | ||
**Format:** `delete <index> ` | ||
|
||
| | Example | | ||
| --------- | ------------------------------------------------------- | | ||
| Input | `delete 6` | | ||
| Output | `Noted, I've removed this task:`<br>`[D][ ] Finish iP (by: Sunday 3pm)` | | ||
|
||
| ||
|
||
### Mark Task As Done : `done` | ||
|
||
Marks task as done.<br> | ||
**Format:** `done <index>` | ||
|
||
| | Example | | ||
| --------- | ------------------------------------------------------- | | ||
| Input | `done 5` | | ||
| Output | `Great job! I've marked this task as done:`<br>`[X] party` | | ||
|
||
| ||
|
||
### Find by Keyword : `find` | ||
|
||
Displays all tasks containing the keyword.<br> | ||
**Format:** `find <keyword>` | ||
|
||
| | Example | | ||
| --------- | ------------------------------------------------------- | | ||
| Input | `find project` | | ||
| Output | `Here are the matching tasks in your list:`<br>`1. [T][ ] do project` | | ||
|
||
| ||
|
||
### Exit : `bye` | ||
|
||
Exits Application.<br> | ||
**Format:** `bye` | ||
|
||
| ||
|
||
## Command summary | ||
|
||
| Command | Format | | ||
| --------- | ------------------------------------------------------- | | ||
| list | `list` | | ||
| todo | `todo <description>` | | ||
| event | `event <description> /at <datetime>` | | ||
| deadline | `deadline <description> /by <datetime>` | | ||
| delete | `delete <index>` | | ||
| done | `done <index>` | | ||
| find | `find <keyword>` | | ||
| bye | `bye` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
theme: jekyll-theme-cayman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package Classes; | ||
|
||
public class Deadline extends Task { | ||
protected String by; | ||
|
||
public Deadline(String description, boolean isDone, String by) { | ||
super(description, isDone); | ||
this.by = by; | ||
} | ||
|
||
/** | ||
* @return String containing description of Deadline task | ||
*/ | ||
@Override | ||
public String toString() { | ||
return "[D]" + super.toString() + "(by: " + this.by + ")"; | ||
} | ||
|
||
/** | ||
* @return String of formatted data to be written into the text file | ||
*/ | ||
public String formatString() { | ||
int done = (isDone ? 1 : 0); | ||
return "D-" + done + "-" + description + "-" + by + "\n"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package Classes; | ||
|
||
public class Event extends Task { | ||
protected String at; | ||
|
||
public Event(String description, boolean isDone, String at) { | ||
super(description, isDone); | ||
this.at= at; | ||
} | ||
|
||
/** | ||
* @return String String containing description of Event task | ||
*/ | ||
@Override | ||
public String toString() { | ||
return "[E]" + super.toString() + "(at: " + this.at + ")"; | ||
} | ||
|
||
/** | ||
* @return String of formatted data to be written into the text file | ||
*/ | ||
public String formatString() { | ||
int done = (isDone ? 1 : 0); | ||
return "E-" + done + "-" + description + "-" + at + "\n"; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package Classes; | ||
|
||
public abstract class Task { | ||
protected String description; | ||
protected boolean isDone; | ||
|
||
public Task(String description) { | ||
this.description = description; | ||
this.isDone = false; | ||
} | ||
|
||
public Task(String description, boolean isDone) { | ||
this.description = description; | ||
this.isDone = isDone; | ||
} | ||
|
||
/** | ||
* @return String with a cross sign if a Task is done, else no cross | ||
*/ | ||
public String getStatusIcon() { | ||
return (isDone ? "X" : " "); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though I understand what you're doing here, from a code readability standpoint, it's best to avoid conditionals in favour of a more explicit and clear if-else statement. |
||
} | ||
|
||
/** | ||
* @return String with description of Task | ||
*/ | ||
public String getDescription() { | ||
return this.description; | ||
} | ||
|
||
/** | ||
* Marks a Task as done | ||
*/ | ||
public void markAsDone() { | ||
this.isDone = true; | ||
} | ||
|
||
/** | ||
* @return String contains whether the Task is done and its description | ||
*/ | ||
public String toString() { | ||
return "[" + getStatusIcon() + "] " + getDescription(); | ||
} | ||
|
||
/** | ||
* @return String of formatted data to be written into the text file | ||
*/ | ||
public abstract String formatString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package Classes; | ||
|
||
public class Todo extends Task { | ||
|
||
public Todo(String description, boolean isDone) { | ||
super(description, isDone); | ||
} | ||
|
||
/** | ||
* @return String containing description of Todo task | ||
*/ | ||
@Override | ||
public String toString() { | ||
return "[T]" + super.toString(); | ||
} | ||
|
||
/** | ||
* @return String of formatted data to be written into the text file | ||
*/ | ||
public String formatString() { | ||
int done = (isDone ? 1 : 0); | ||
return "T-" + done + "-" + description + "\n"; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a more descriptive variable name that better illustrates what the variable represents.