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

[shawnpong] iP #178

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Jan 7, 2024
f837ddb
Add Gradle support
May 24, 2020
a6f7324
Bump gradle and lib version
Eclipse-Dominator Aug 5, 2023
acf8fdf
Added name for my chatbot
shawnpong Feb 1, 2024
623f216
Added echo functionality for George
shawnpong Feb 1, 2024
46afd35
Added list tracking functionality
shawnpong Feb 2, 2024
66efd52
Added mark, unmark functionality
shawnpong Feb 2, 2024
8cb1b88
Changed bot name, abide by coding standard
shawnpong Feb 2, 2024
a37a35f
Add Task class
shawnpong Feb 8, 2024
5195542
Add Task,ToDo, Deadline class
shawnpong Feb 8, 2024
118c2de
Follow coding standard
shawnpong Feb 8, 2024
0e1e695
Add methods to handle different tasks
shawnpong Feb 14, 2024
ea1adcb
Add exception handling
shawnpong Feb 15, 2024
2d89f52
Fix bugs
shawnpong Feb 15, 2024
190535f
Merge remote-tracking branch 'origin/add-gradle-support' into branch-…
shawnpong Feb 15, 2024
14cbebb
Revert "Bump gradle and lib version"
shawnpong Feb 15, 2024
f6e276f
Merge remote-tracking branch 'origin/add-gradle-support'
shawnpong Feb 15, 2024
a2c95c2
Revert "Bump gradle and lib version"
shawnpong Feb 15, 2024
3fd63f3
Merge branch 'master' into branch-Level-5
shawnpong Feb 15, 2024
52ab77b
Remove files
shawnpong Feb 15, 2024
4894ef2
Level-5
shawnpong Feb 16, 2024
3992ded
Merge branch 'branch-Level-5'
shawnpong Feb 16, 2024
4293c01
Add more exception handling
shawnpong Feb 20, 2024
a67bf9b
Implement ArrayList for dynamic array handling
shawnpong Feb 20, 2024
46d6cc1
Add save functionality, gitignore list data
shawnpong Feb 21, 2024
d3003ef
Add gitignore
shawnpong Feb 21, 2024
0c702d7
Merge branch 'branch-Level-7'
shawnpong Feb 21, 2024
aa38640
Merge branch 'branch-Level-6'
shawnpong Feb 21, 2024
2288a85
Fix bugs with regard to using ArrayList
shawnpong Feb 21, 2024
db336b4
Add Parser, Storage, TaskList, Ui classes
shawnpong Feb 29, 2024
c8b6a97
Add Find functionality
shawnpong Feb 29, 2024
c6a0097
Merge branch 'branch-Level-9'
shawnpong Feb 29, 2024
e7bc46d
Add JavaDoc to code
shawnpong Feb 29, 2024
19e3ebf
Add branch
shawnpong Mar 4, 2024
f45955d
Merge branch 'master' into branch-Level-9
shawnpong Mar 4, 2024
02ec784
Merge pull request #1 from shawnpong/branch-Level-9
shawnpong Mar 4, 2024
6f0f9e7
Testing README
shawnpong Mar 5, 2024
00aadd0
Testing README
shawnpong Mar 5, 2024
8d5f63a
Add README user guide
shawnpong Mar 5, 2024
c7abf86
Update README with colours!
shawnpong Mar 5, 2024
bb716bf
Change README colours
shawnpong Mar 5, 2024
8dc40dc
Add javadoc for ToDo
shawnpong Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ bin/

/text-ui-test/ACTUAL.TXT
text-ui-test/EXPECTED-UNIX.TXT

/data/

146 changes: 130 additions & 16 deletions docs/README.md
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.
![img.png](img.png)

### 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
```
Binary file added docs/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions src/main/java/Deadline.java
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

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

public String toString() {
return "[D] " + super.getStatusIcon() + " " + super.toString() + " (by: " + by + ")";
}
}
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

52 changes: 52 additions & 0 deletions src/main/java/Events.java
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 + ")";
}
}
40 changes: 40 additions & 0 deletions src/main/java/Floda.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import java.util.Scanner;

Choose a reason for hiding this comment

The 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) {
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();
}
}
13 changes: 13 additions & 0 deletions src/main/java/InvalidInputException.java
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);
}
}
3 changes: 3 additions & 0 deletions src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Floda

Loading