-
Notifications
You must be signed in to change notification settings - Fork 187
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
[shawnpong] iP #178
Open
shawnpong
wants to merge
42
commits into
nus-cs2113-AY2324S2:master
Choose a base branch
from
shawnpong: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
[shawnpong] iP #178
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
55f9f9f
docs/README.md: Tweak document template
f837ddb
Add Gradle support
a6f7324
Bump gradle and lib version
Eclipse-Dominator acf8fdf
Added name for my chatbot
shawnpong 623f216
Added echo functionality for George
shawnpong 46afd35
Added list tracking functionality
shawnpong 66efd52
Added mark, unmark functionality
shawnpong 8cb1b88
Changed bot name, abide by coding standard
shawnpong a37a35f
Add Task class
shawnpong 5195542
Add Task,ToDo, Deadline class
shawnpong 118c2de
Follow coding standard
shawnpong 0e1e695
Add methods to handle different tasks
shawnpong ea1adcb
Add exception handling
shawnpong 2d89f52
Fix bugs
shawnpong 190535f
Merge remote-tracking branch 'origin/add-gradle-support' into branch-…
shawnpong 14cbebb
Revert "Bump gradle and lib version"
shawnpong f6e276f
Merge remote-tracking branch 'origin/add-gradle-support'
shawnpong a2c95c2
Revert "Bump gradle and lib version"
shawnpong 3fd63f3
Merge branch 'master' into branch-Level-5
shawnpong 52ab77b
Remove files
shawnpong 4894ef2
Level-5
shawnpong 3992ded
Merge branch 'branch-Level-5'
shawnpong 4293c01
Add more exception handling
shawnpong a67bf9b
Implement ArrayList for dynamic array handling
shawnpong 46d6cc1
Add save functionality, gitignore list data
shawnpong d3003ef
Add gitignore
shawnpong 0c702d7
Merge branch 'branch-Level-7'
shawnpong aa38640
Merge branch 'branch-Level-6'
shawnpong 2288a85
Fix bugs with regard to using ArrayList
shawnpong db336b4
Add Parser, Storage, TaskList, Ui classes
shawnpong c8b6a97
Add Find functionality
shawnpong c6a0097
Merge branch 'branch-Level-9'
shawnpong e7bc46d
Add JavaDoc to code
shawnpong 19e3ebf
Add branch
shawnpong f45955d
Merge branch 'master' into branch-Level-9
shawnpong 02ec784
Merge pull request #1 from shawnpong/branch-Level-9
shawnpong 6f0f9e7
Testing README
shawnpong 00aadd0
Testing README
shawnpong 8d5f63a
Add README user guide
shawnpong c7abf86
Update README with colours!
shawnpong bb716bf
Change README colours
shawnpong 8dc40dc
Add javadoc for ToDo
shawnpong 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 |
---|---|---|
|
@@ -15,3 +15,6 @@ bin/ | |
|
||
/text-ui-test/ACTUAL.TXT | ||
text-ui-test/EXPECTED-UNIX.TXT | ||
|
||
/data/ | ||
|
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,29 +1,143 @@ | ||
# User Guide | ||
# <span style="color:Orange">Floda User Guide | ||
|
||
## Features | ||
Floda is a command-line to-do list application designed to help you manage your tasks efficiently. It allows you to add, delete, mark as done, and list tasks with ease. | ||
## <span style="color:Purple">Quick Start | ||
|
||
### Feature-ABC | ||
Prerequisites: JDK 11, Intellij. | ||
|
||
Description of the feature. | ||
1. Ensure you have Java installed on your computer. | ||
2. Download the latest Floda.jar file from [here](https://github.com/shawnpong/ip/releases). | ||
3. Place the downloaded file in your desired directory. | ||
4. Open up a command prompt and navigate to the directory Floda.jar is in. | ||
- You can do so on windows by typing 'cmd' in the file explorer address bar. | ||
5. Run the application using the command 'java -jar Floda.jar'. | ||
6. A CLI similar to the below should appear. | ||
 | ||
|
||
### Feature-XYZ | ||
## <span style="color:Purple">Features | ||
### <span style="color:Orange">Adding a Todo: `todo` | ||
|
||
Description of the feature. | ||
Add a task with description to your to-do list | ||
|
||
## Usage | ||
Format: `todo <description>` | ||
|
||
### `Keyword` - Describe action | ||
Replace `<description>` with a brief description of your task. | ||
|
||
Describe the action and its outcome. | ||
Example Input: `todo Buy Groceries` | ||
|
||
Example of usage: | ||
Example Output: `Added: [T] [ ] Buy groceries` | ||
|
||
`keyword (optional arguments)` | ||
### <span style="color:Orange">Adding a Deadline: `deadline` | ||
|
||
Expected outcome: | ||
Add a task with description and a deadline to your to-do list | ||
|
||
Format: `deadline <description> /by <deadline>` | ||
|
||
Replace `<description>` with a brief description of your task and `<deadline>` with the due date/time. | ||
|
||
Example Input: `deadline Submit report /by 2024-03-10` | ||
|
||
Example Output: `Added: [D] [ ] Submit report (by: 2024-03-10)` | ||
|
||
### <span style="color:Orange">Adding a Event: `event` | ||
|
||
Add a task with description and a start and end time to your to-do list | ||
|
||
Format: `event <description> /from <start time> /to <end time>` | ||
|
||
Replace `<description>` with a brief description of your task, `<start time>` with the event start time, and `<end time>` with the event end time. | ||
|
||
Example Input: `event Team meeting /from 2024-03-08 14:00 /to 2024-03-08 16:00` | ||
|
||
Example Output: `Added: [E] [ ] Team meeting (from: 2024-03-08 14:00 to: 2024-03-08 16:00)` | ||
|
||
### <span style="color:Orange">Listing Tasks: `list` | ||
|
||
To view all tasks in your to-do list so far | ||
|
||
Format: `list` | ||
|
||
Example Output: `<task number> [<task type>] [<task status>] <task description> (additional details)` | ||
1. [T] [ ] Buy groceries | ||
2. [D] [ ] Submit report (by: 2024-03-10) | ||
3. [E] [ ] Team meeting (from: 2024-03-08 14:00 to: 2024-03-08 16:00) | ||
|
||
### <span style="color:Orange">Deleting a Task: `delete` | ||
|
||
To delete a specific task in your todo list | ||
|
||
Format: `delete <task number>` | ||
|
||
Replace `<task number>` with the number corresponding to the task you want to delete. | ||
> Tip: Use the command `list` to find the `<task number>` of the task you wish you delete | ||
|
||
### <span style="color:Orange">Marking a Task as Done: `mark` | ||
|
||
Mark a specific task as done in your to-do list | ||
|
||
Format: `mark <task number>` | ||
|
||
Replace `<task number>` with the number corresponding to the task you want to mark as done. | ||
> Tip: Use the command `list` to find the `<task number>` of the task you wish to mark as done. | ||
|
||
Example Input: `mark 1` | ||
|
||
Example Output: `I have marked this task as done: [T] [X] Buy Groceries` | ||
|
||
### <span style="color:Orange">Unmarking a Task: `unmark` | ||
|
||
Remove the completion status of a specific task in your to-do list | ||
|
||
Format: `unmark <task number>` | ||
|
||
Replace `<task number>` with the number corresponding to the task you want to unmark. | ||
> Tip: Use the command `list` to find the `<task number>` of the task you wish to unmark. | ||
|
||
Example Input: `unmark 1` | ||
|
||
Example Output: `I have marked this task as not done: [T] [ ] Buy Groceries` | ||
|
||
|
||
### <span style="color:Orange">Finding Tasks: `find` | ||
|
||
Search for tasks containing a specific keyword in your to-do list | ||
|
||
Format: `find <keyword>` | ||
|
||
Replace `<keyword>` with the keyword you want to search for in your tasks. | ||
|
||
Example Input: `find meeting` | ||
|
||
Example Output: `Here are the matching tasks in your list: | ||
1.[E] [ ] Team meeting (from: 2024-03-08 14:00 to: 2024-03-08 16:00)` | ||
|
||
### <span style="color:Orange">Exiting the Application: `bye` | ||
|
||
Exits the Floda application | ||
|
||
Format: `bye` | ||
|
||
### <span style="color:Orange">Saving tasks | ||
|
||
Tasks are automatically saved to the tasks.txt file in the application directory after any command that modifies the task list. | ||
|
||
### <span style="color:Orange">Editing the Data File | ||
|
||
You can directly edit the tasks.txt file to update tasks. Ensure the file format remains valid to avoid data loss. | ||
>Caution: If your changes to the data file makes its format invalid, AddressBook will discard all data and start with an empty data file at the next run. Hence, it is recommended to take a backup of the file before editing it. | ||
|
||
## <span style="color:LightBlue">Command Summary | ||
|
||
| Command | Description | Example Usage | | ||
|---------------------------------------------------------|------------------------------------------------------------|--------------------------------| | ||
| `todo <description>` | Add a Todo task to the list with a description. | `todo Buy Groceries` | | ||
| `deadline <description> /by <deadline>` | Add a Deadline task with a description and deadline. | `deadline Submit report /by 2024-03-10` | | ||
| `event <description> /from <start time> /to <end time>` | Add an Event task with a description and time frame. | `event Team meeting /from 2024-03-08 14:00 /to 2024-03-08 16:00` | | ||
| `list` | View all tasks in the to-do list. | `list` | | ||
| `delete <task number>` | Delete a specific task from the list. | `delete 1` | | ||
| `mark <task number>` | Mark a task as done. | `mark 1` | | ||
| `unmark <task number>` | Remove the completion status of a task. | `unmark 1` | | ||
| `find <keyword>` | Search for tasks containing a specific keyword. | `find meeting` | | ||
| `bye` | Exit the application. | `bye` | | ||
|
||
Description of the outcome. | ||
|
||
``` | ||
expected output | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,39 @@ | ||
/** | ||
* The Deadline class represents a task with a deadline. | ||
*/ | ||
public class Deadline extends Task { | ||
/** The deadline of the task. */ | ||
protected String by; | ||
|
||
/** | ||
* Constructs a Deadline object with the specified description, deadline, and completion status. | ||
* | ||
* @param description The description of the deadline task. | ||
* @param by The deadline of the task. | ||
* @param isDone The completion status of the task. | ||
*/ | ||
public Deadline(String description, String by, Boolean isDone) { | ||
super(description); | ||
this.by = by; | ||
this.isDone = isDone; | ||
} | ||
|
||
/** | ||
* Retrieves the deadline of the task. | ||
* | ||
* @return The deadline of the task. | ||
*/ | ||
public String getBy() { | ||
return by; | ||
} | ||
|
||
/** | ||
* Returns a string representation of the deadline task. | ||
* | ||
* @return A string representation of the deadline task. | ||
*/ | ||
@Override | ||
public String toString() { | ||
return "[D] " + super.getStatusIcon() + " " + super.toString() + " (by: " + by + ")"; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
/** | ||
* The Events class represents a task that spans over a period of time. | ||
*/ | ||
public class Events extends Task { | ||
/** The start time of the event. */ | ||
protected String from; | ||
/** The end time of the event. */ | ||
protected String to; | ||
|
||
/** | ||
* Constructs an Events object with the specified description, start time, end time, and completion status. | ||
* | ||
* @param description The description of the event task. | ||
* @param from The start time of the event. | ||
* @param to The end time of the event. | ||
* @param isDone The completion status of the event task. | ||
*/ | ||
public Events(String description, String from, String to, Boolean isDone) { | ||
super(description); | ||
this.from = from; | ||
this.to = to; | ||
this.isDone = isDone; | ||
} | ||
|
||
/** | ||
* Retrieves the start time of the event. | ||
* | ||
* @return The start time of the event. | ||
*/ | ||
public String getFrom() { | ||
return from; | ||
} | ||
|
||
/** | ||
* Retrieves the end time of the event. | ||
* | ||
* @return The end time of the event. | ||
*/ | ||
public String getTo() { | ||
return to; | ||
} | ||
|
||
/** | ||
* Returns a string representation of the event task. | ||
* | ||
* @return A string representation of the event task. | ||
*/ | ||
@Override | ||
public String toString() { | ||
return "[E] " + super.getStatusIcon() + " " + super.toString() + " (from: " + from + " to: " + to + ")"; | ||
} | ||
} |
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,40 @@ | ||
import java.util.Scanner; | ||
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. I like how you specified java.util.Scanner instead of java.util.* , this complies with coding standards, well done ! |
||
import java.io.FileNotFoundException; | ||
|
||
|
||
/** | ||
* Main class for the Floda application. | ||
*/ | ||
public class Floda { | ||
private static final String NAME = "Floda"; | ||
public static final String FILE_PATH = "./data/tasks.txt"; | ||
private static final Ui ui = new Ui(); | ||
private static final Storage storage = new Storage(FILE_PATH); | ||
private static final TaskList tasks = new TaskList(storage); | ||
|
||
/** | ||
* Main method to run the Floda application. | ||
* | ||
* @param args The command-line arguments. | ||
*/ | ||
public static void main(String[] args) { | ||
shawnpong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ui.showWelcomeMessage(NAME); | ||
try { | ||
tasks.loadTasks(); | ||
} catch (FileNotFoundException | InvalidInputException e) { | ||
ui.showErrorMessage(e.getMessage()); | ||
} | ||
|
||
Scanner scanner = new Scanner(System.in); | ||
ui.showInstructions(); | ||
while (TaskList.isActive) { | ||
try { | ||
String line = scanner.nextLine().trim(); | ||
Parser.parseCommand(line); | ||
} catch (InvalidInputException e) { | ||
ui.showErrorMessage(e.getMessage()); | ||
} | ||
} | ||
scanner.close(); | ||
} | ||
} |
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,13 @@ | ||
/** | ||
* The InvalidInputException class represents an exception that is thrown when the input provided is invalid. | ||
*/ | ||
public class InvalidInputException extends Exception { | ||
/** | ||
* Constructs an InvalidInputException with the specified error message. | ||
* | ||
* @param errorMessage The error message describing the nature of the invalid input. | ||
*/ | ||
public InvalidInputException(String errorMessage) { | ||
super(errorMessage); | ||
} | ||
} |
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,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: Floda | ||
|
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.
Great use of Override annotation to signal method overriding