-
Notifications
You must be signed in to change notification settings - Fork 196
[wongyihao0506] iP #183
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
Open
wongyihao0506
wants to merge
27
commits into
nus-cs2113-AY2425S2:master
Choose a base branch
from
wongyihao0506: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
[wongyihao0506] iP #183
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
569bacb
Level 1-0
wongyihao0506 bb64ed2
1-1
wongyihao0506 83191de
1-2
wongyihao0506 4d661f8
1-3
wongyihao0506 42b41d7
1-4
wongyihao0506 a51c4e7
Code quality improvement
wongyihao0506 1a9f0d3
Level 1-5 Handling input errors
wongyihao0506 e4991ab
Level 1-5 Handling input errors
wongyihao0506 0cad93d
Added exception class
wongyihao0506 e938d8c
Merge branch 'Branch-Level_5'
wongyihao0506 aa30967
Level 1-6 Deleting tasks
wongyihao0506 00934d1
Improved Level_7
wongyihao0506 f08ff4c
Merge branch 'Branch-Level_6'
wongyihao0506 a9e3817
Merge branch 'Branch-Level_7'
wongyihao0506 2907308
A-Exceptions updated
wongyihao0506 b9aa3b1
A-Exceptions updated
wongyihao0506 14fb725
A-MoreOOP
wongyihao0506 be22d07
Level-9
wongyihao0506 94d3f42
Code quality and standards improved
wongyihao0506 934f061
Level-9
wongyihao0506 df8662b
Branch-Level-9
wongyihao0506 d7c8703
Minor fixes
wongyihao0506 8488c9d
A-JavaDoc
wongyihao0506 785ab6d
A-JavaDoc updated
wongyihao0506 e4f1c44
A-UserGuide
wongyihao0506 d76f2a4
A-UserGuide updated
wongyihao0506 260c915
Merge pull request #1 from wongyihao0506/Branch-Level-9
wongyihao0506 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 hidden or 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
This file contains hidden or 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,2 @@ | ||
| T | 0 | return book | ||
| T | 0 | return book |
This file contains hidden or 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,30 +1,96 @@ | ||
| # Duke User Guide | ||
| # Growler Project | ||
| **A Java-based CLI task management assistant** | ||
|
|
||
| // Update the title above to match the actual product name | ||
| --- | ||
|
|
||
| // Product screenshot goes here | ||
| ## **Introduction** | ||
| **Growler** is a simple and interactive **command-line chatbot** that helps you manage your daily tasks efficiently. You can add different types of tasks, mark them as done, and list them in an organized manner. Growler is built using Java and adopts a step by step development process. | ||
|
|
||
| // Product intro goes here | ||
| --- | ||
|
|
||
| ## Adding deadlines | ||
| ### **Features** | ||
| - **Task Management** | ||
| - **ToDo**: Simple tasks without a date (e.g., `todo read book`) | ||
| - **Deadline**: Tasks with a due date (e.g., `deadline submit assignment /by Sunday`) | ||
| - **Event**: Tasks with a start and end time (e.g., `event group meeting /from 9pm /to 11pm`) | ||
| - **Task Completion** | ||
| - Mark tasks as done (`mark 2`) or not done (`unmark 2`), according to the index of the task | ||
| - **Task Search** | ||
| - Finds and displays all tasks which contains a keyword (e.g., `find book`) | ||
| - **Task Deletion** | ||
| - Deletes task according to its index (e.g., `delete 2`) | ||
| - **Task Listing** | ||
| - View all added tasks (`list`) | ||
| - **User-friendly CLI** | ||
| - Growler interacts with users through an easy-to-use command-line interface. | ||
|
|
||
| // Describe the action and its outcome. | ||
| --- | ||
|
|
||
| // Give examples of usage | ||
| ## **Setting Up in IntelliJ IDEA** | ||
| ### **Prerequisites** | ||
| - **JDK 17** (Ensure Java 17 is installed) | ||
| - **Latest version of IntelliJ IDEA** | ||
|
|
||
| Example: `keyword (optional arguments)` | ||
| ### **Installation Steps** | ||
| 1. **Open IntelliJ IDEA** | ||
| - If a project is already open, go to `File` > `Close Project` to return to the welcome screen. | ||
|
|
||
| // A description of the expected outcome goes here | ||
| 2. **Import the Project** | ||
| - Click **Open** | ||
| - Select the project directory | ||
| - Click **OK** and accept all default settings. | ||
|
|
||
| ``` | ||
| expected output | ||
| ``` | ||
| 3. **Set up the correct JDK** | ||
| - Go to **`File` > `Project Structure` > `Project`** | ||
| - Set **Project SDK** to `JDK 17` | ||
| - Set **Project language level** to `SDK default` | ||
| - Click `Apply` and `OK` | ||
|
|
||
| ## Feature ABC | ||
| 4. **Run Growler** | ||
| - Navigate to `src/main/java/Istella.java` | ||
| - Right-click on `Growler.java`, select **Run 'Growler'** | ||
| - If everything is set up correctly, you should see the following output: | ||
|
|
||
| // Feature details | ||
| Hello! I'm Growler | ||
|
|
||
| What can I do for you? | ||
|
|
||
| ## Feature XYZ | ||
|
|
||
| // Feature details | ||
| --- | ||
|
|
||
| ## **Usage Guide** | ||
| Here are some example commands to interact with Growler: | ||
|
|
||
| | **Command** | **Description** | **Example** | | ||
| |----------------------------------------|------------------------------------|------------------------------------------| | ||
| | `todo <task>` | Adds a **ToDo** task | `todo buy milk` | | ||
| | `deadline <task> /by <date>` | Adds a **Deadline** task | `deadline project submission /by Sunday` | | ||
| | `event <task> /from <start> /to <end>` | Adds an **Event** task | `event concert /from 6pm /to 10pm` | | ||
| | `list` | Displays all added tasks | `list` | | ||
| | `mark <task number>` | Marks a task as done | `mark 2` | | ||
| | `unmark <task number>` | Marks a task as not done | `unmark 2` | | ||
| | `delete <task number>` | Deletes task specified index | `delete 2` | | ||
| | `find <keyword>` | Finds all tasks containing keyword | `find book` | | ||
| | `bye` | Exits Growler | `bye` | | ||
|
|
||
|
|
||
| ## **Important Notes** | ||
| - **Keep all Java files inside `src/main/java/`** | ||
| - Do not rename or move this directory, as tools like Gradle rely on it. | ||
| - **Use Java 17** | ||
| - Running the project with a different Java version may cause compatibility issues. | ||
|
|
||
| --- | ||
|
|
||
| ## **Further Enhancements** | ||
| - Implement **reminders** (reminds user of task deadlines/upcoming events) | ||
| - Implement **Categorization of tasks** (Categorizes based on work/personal/family/etc) | ||
| - Implement **graphical user interface (GUI)** using JavaFX | ||
|
|
||
| --- | ||
|
|
||
| ## **Contributing** | ||
| Feel free to contribute by: | ||
| - Forking the repository | ||
| - Adding feature branches | ||
| - Submitting pull requests |
This file contains hidden or 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 @@ | ||
| /** | ||
| * Represents a task with a deadline. | ||
| * A Deadline task has a name and a due date, in addition to the standard task properties. | ||
| */ | ||
| public class Deadline extends Task { | ||
| protected String dueDate; | ||
|
|
||
| /** | ||
| * Constructs a Deadline task with the specified task name and due date. | ||
| * | ||
| * @param taskName The name of the task. | ||
| * @param dueDate The due date of the task. | ||
| */ | ||
| public Deadline(String taskName, String dueDate) { | ||
| super(taskName); | ||
| this.dueDate = dueDate; | ||
| } | ||
|
|
||
| /** | ||
| * Returns a string representation of the Deadline task, including its type, | ||
| * task name, and due date. | ||
| * | ||
| * @return A formatted string representing the Deadline task. | ||
| */ | ||
| @Override | ||
| public String toString() { | ||
| return "[D]" + super.toString() + " (by: " + dueDate + ")"; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the Deadline task in a format suitable for file storage. | ||
| * | ||
| * @return A formatted string representing the Deadline task for saving to a file. | ||
| */ | ||
| @Override | ||
| public String toFileFormat() { | ||
| return "D | " + (isDone ? "1" : "0") + " | " + taskName + " | " + dueDate; | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,43 @@ | ||
| /** | ||
| * The Event class represents a task that occurs between a start date and an end date. | ||
| * It extends the Task class and adds fields for the event's start and end dates. | ||
| */ | ||
| public class Event extends Task { | ||
| protected String startDate; | ||
| protected String endDate; | ||
|
|
||
| /** | ||
| * Constructs an Event with the specified task name, start date, and end date. | ||
| * | ||
| * @param taskName The name of the task. | ||
| * @param startDate The start date of the event. | ||
| * @param endDate The end date of the event. | ||
| */ | ||
| public Event(String taskName, String startDate, String endDate) { | ||
| super(taskName); | ||
| this.startDate = startDate; | ||
| this.endDate = endDate; | ||
| } | ||
|
|
||
| /** | ||
| * Returns a string representation of the Event task. | ||
| * The format is "[E] <taskName> (from: <startDate> to: <endDate>)". | ||
| * | ||
| * @return A string representing the Event task in the specified format. | ||
| */ | ||
| @Override | ||
| public String toString(){ | ||
| return "[E]" + super.toString() + " (from: " + startDate + " to: " + endDate + ")"; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the Event task in a format suitable for saving to a file. | ||
| * The format is "E | <isDone> | <taskName> | <startDate> | <endDate>". | ||
| * | ||
| * @return A string representing the Event task in a file-friendly format. | ||
| */ | ||
| @Override | ||
| public String toFileFormat() { | ||
| return "E | " + (isDone ? "1" : "0") + " | " + taskName + " | " + startDate + " | " + endDate; | ||
| } | ||
| } |
This file contains hidden or 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,41 @@ | ||
| import java.util.Scanner; | ||
|
|
||
| /** | ||
| * The Growler class is the main entry point for the Growler application. | ||
| * It initializes the necessary components (Storage, Ui, Parser, TaskList) and processes user commands. | ||
| * The program runs in a loop until the user types "bye", handling task management operations. | ||
| */ | ||
| public class Growler { | ||
|
|
||
| /** | ||
| * The main method starts the Growler application and processes user commands. | ||
| * It initializes the storage, UI, parser, and task list, then enters a loop to process commands. | ||
| * The loop continues until the user types "bye". | ||
| * | ||
| * @param args Command-line arguments (not used in this application). | ||
| * @throws GrowlerException If there is an error while handling tasks (e.g., invalid task format). | ||
| */ | ||
| public static void main(String[] args) throws GrowlerException { | ||
| Storage storage = new Storage(); | ||
| Ui ui = new Ui(); | ||
| Parser parser = new Parser(); | ||
| Task[] tasks = new Task[100]; | ||
| int taskCount = storage.loadTasks(tasks); // Load existing tasks from storage | ||
| TaskList taskList = new TaskList(tasks, taskCount); | ||
| ui.showWelcomeMessage(); | ||
| Scanner in = new Scanner(System.in); | ||
| while (true) { | ||
| String userInput = in.nextLine(); // Get user input | ||
| if (userInput.equals("bye")) { | ||
| ui.showGoodbyeMessage(); | ||
| break; | ||
| } | ||
| try { | ||
| parser.handleCommand(userInput, taskList, storage, ui); | ||
| } catch (GrowlerException e) { | ||
| ui.showError(e.getMessage()); | ||
| } | ||
| } | ||
| in.close(); | ||
| } | ||
| } | ||
|
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.
|
||
This file contains hidden or 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,15 @@ | ||
| /** | ||
| * The GrowlerException class is a custom exception used in the Growler application. | ||
| * It extends the {@link Exception} class and allows for handling specific errors that occur in the application. | ||
| */ | ||
| public class GrowlerException extends Exception { | ||
|
|
||
| /** | ||
| * Constructs a new GrowlerException with the specified detail message. | ||
| * | ||
| * @param message The detail message to describe the exception. | ||
| */ | ||
| public GrowlerException(String message) { | ||
| super(message); | ||
| } | ||
| } |
This file contains hidden or 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: Growler | ||
|
|
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.
Very bad case of arrow head code. I suggest doing more abstraction/ SLAP