Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
288af6d
Level-0
JinbaoAlex Feb 6, 2025
df3b9c3
Level-1 Echo
JinbaoAlex Feb 6, 2025
2477cf4
Level-2 Added ability to store whatever text entered by the user and …
JinbaoAlex Feb 6, 2025
55f740f
Level-3 and A-Classes Added the ability to mark tasks as done, the a…
JinbaoAlex Feb 6, 2025
8b981b3
Level-3 and A-Classes Added the ability to mark tasks as done, the a…
JinbaoAlex Feb 6, 2025
dc2fcfe
Level-4 Add support for tracking todos, deadlines, and events as tasks
JinbaoAlex Feb 7, 2025
9067561
improved code quality, added tags to past commits
JinbaoAlex Feb 7, 2025
95b59f4
A-Exceptions Added exception handling for mark and unmark commands
JinbaoAlex Feb 14, 2025
ed07bac
Level-5 Handling errors in mark/unmark and todo/deadline/event
JinbaoAlex Feb 14, 2025
fa886f8
Merge branch 'branch-Level-5'
JinbaoAlex Feb 14, 2025
02d80d2
Level-6 added delete command
JinbaoAlex Feb 20, 2025
fe957b7
Level-7 added ability to save and load data
JinbaoAlex Feb 21, 2025
7947949
Merge branch 'branch-Level-6'
JinbaoAlex Feb 21, 2025
cb13a7e
Merge branch 'branch-Level-7'
JinbaoAlex Feb 21, 2025
ab17569
FIxed mistakes in delete and save commands
JinbaoAlex Feb 22, 2025
83911f6
A-MoreOOP Refactor code for oop with Ui, Storage, Parser, Tasklist, a…
JinbaoAlex Mar 13, 2025
b90a9f5
Level-8 Date and Times
JinbaoAlex Mar 13, 2025
c2a95b1
Level-9 Added find feature
JinbaoAlex Mar 13, 2025
fca55c5
A-JavaDoc Added JavaDoc comments for most methods and classes
JinbaoAlex Mar 14, 2025
e572876
Merge pull request #1 from JinbaoAlex/branch-Level-8
JinbaoAlex Mar 14, 2025
2be662a
Merge pull request #2 from JinbaoAlex/branch-Level-9
JinbaoAlex Mar 14, 2025
be52433
Merge branch 'master' of https://github.com/JinbaoAlex/ip
JinbaoAlex Mar 14, 2025
ea6a275
Merge branch 'branch-A-JavaDoc'
JinbaoAlex Mar 14, 2025
7e2666d
Added more javadoc comments
JinbaoAlex Mar 14, 2025
ace02c7
added some additional exception handling
JinbaoAlex Mar 14, 2025
6d4f779
updated userguide and customised the chatbot's message
JinbaoAlex Mar 14, 2025
3f539fc
added summary table for the user guide
JinbaoAlex Mar 14, 2025
1bcf83b
add A-UserGuide tag
JinbaoAlex Mar 14, 2025
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
167 changes: 153 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,169 @@
# Duke User Guide
# Volkov User Guide

// Update the title above to match the actual product name
Volkov is a command-line task manager that allows you to add 3 different types of tasks,
set their relevant dates, and track your progress on the tasks with simple commands.
Your tasks are saved automatically, allowing you to revisit whenever you need to.

// Product screenshot goes here
## Adding a Todo Task: `todo`
Adds a todo task for Volkov to remember.

// Product intro goes here
**Format:**
`todo DESCRIPTION`
**Examples:**
```
todo buy groceries
```
**Expected Outcome:**
```
____________________________________________________________
Roger. Task has been added to the list:
[T][ ] buy groceries
You now have 1 tasks in the list.
____________________________________________________________

```

## Adding a Deadline Task: `deadline`
Adds a deadline task for Volkov to remember.

**Format:**
`deadline DESCRIPTION /by DATE`
**Examples:**
```
deadline do homework /by 2025-03-14
```
**Expected Outcome:**
```
____________________________________________________________
Roger. Task has been added to the list:
[D][ ] do homework (by: Mar 14 2025)
You now have 2 tasks in the list.
____________________________________________________________
```

## Adding an Event Task: `event`
Adds an event task for Volkov to remember.

**Format:**
`event DESCRIPTION /from STARTDATE /to ENDDATE`
**Examples:**
```
event open house /from 2025-02-16 /to 2025-02-18
```
**Expected Outcome:**
```
____________________________________________________________
Roger. Task has been added to the list:
[E][ ] open house (from: Feb 16 2025 to: Feb 18 2025)
You now have 3 tasks in the list.
____________________________________________________________
```

## Mark a task as done: `mark`
Marks a task as completed in Volkov's task list.

**Format:**
`mark TASKNO`
**Examples:**
```
mark 1
```
**Expected Outcome:**
```
____________________________________________________________
Roger. This task has been marked as done:
[T][X] buy groceries
____________________________________________________________
```

## Adding deadlines
## Mark a task as notdone: `unmark`
Marks a task as uncompleted in Volkov's task list.

// Describe the action and its outcome.
**Format:**
`unmark TASKNO`
**Examples:**
```
unmark 1
```
**Expected Outcome:**
```
____________________________________________________________
Roger. This task has been marked as not done yet:
[T][ ] buy groceries
____________________________________________________________
```

// Give examples of usage
## Delete a task: `delete`
Removes a task from Volkov's task list.

Example: `keyword (optional arguments)`
**Format:**
`delete TASKNO`
**Examples:**
```
delete 2
```
**Expected Outcome:**
```
____________________________________________________________
Roger. Task has been removed:
[D][ ] do homework (by: Mar 14 2025)
You now have 2 tasks in the list.
____________________________________________________________
```

// A description of the expected outcome goes here
## List all tasks: `list`
Lists all tasks in Volkov's task list.

**Format:**
`list`
**Expected Outcome:**
```
expected output
____________________________________________________________
These are all the tasks in your list:
1.[T][ ] buy groceries
2.[E][ ] open house (from: Feb 16 2025 to: Feb 18 2025)
____________________________________________________________
```

## Feature ABC
## Find a task: `find`
Finds the tasks in Volkov's task list that match the query

// Feature details
**Format:**
`find SEARCHTERM`
**Examples:**
```
find groceries
```
**Expected Outcome:**
```
____________________________________________________________
These are the tasks that match you search query:
1.[T][ ] buy groceries
____________________________________________________________
```

## Exit Program: `bye`
Saves the task list on the hard disk and closes the program

**Format:**
`bye`
**Expected Outcome:**
```
____________________________________________________________
See you again soon! Service terminated.
____________________________________________________________
```

## Feature XYZ
### Command Summary

// Feature details
| Action | Format and Examples |
|--------------|--------------------------------------------------------------------------------------------------------------|
| **Todo** | `todo DESCRIPTION`<br/>e.g., `todo buy groceries` |
| **Deadline** | `deadline DESCRIPTION /by DATE`<br/>e.g., `deadline do homework /by 2025-03-14` |
| **Event** | `event DESCRIPTION /from STARTDATE /to ENDDATE`<br/>e.g., `event open house /from 2025-02-16 /to 2025-02-18` |
| **Mark** | `mark TASKNO`<br/>e.g., `mark 1` |
| **Unmark** | `unmark TASKNO`<br/>e.g., `unmark 1` |
| **Delete** | `delete TASKNO`<br/>e.g., `delete 1` |
| **List** | `list` |
| **Find** | `find SEARCHTERM`<br/>e.g., `find groceries` |
| **Bye** | `bye` |
25 changes: 25 additions & 0 deletions src/main/java/ByeCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Represents the command to exit the program
*/
public class ByeCommand extends Commands {

/**
* Executes the exit command by displaying a farewell message to the user.
*
* @param tasks The {@code TaskList} containing all tasks.
* @param ui The {@code Ui} for user interaction.
* @param storage The {@code Storage} for file operations.
*/
public void execute(TaskList tasks, Ui ui, Storage storage) {
new Ui().formatResponse(" See you again soon! Service terminated.");
}

/**
* Returns boolean true to indicate the exiting of the program
*
* @return {@code true}
*/
public boolean isExit() {
return true;
}
}
29 changes: 29 additions & 0 deletions src/main/java/Commands.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Represents an abstract command to be executed in the main body.
* Subclasses of {@code Commands} implements methods with specific behavior
* relevant to their respective commands
*/
public abstract class Commands {
/**
* Executes the command with the task list, user interface, and storage.
* <p>
* Exact implementations depends on the relevant command.
*
* @param tasks The {@code TaskList} containing all tasks.
* @param ui The {@code Ui} object handling user interactions.
* @param storage The {@code Storage} object for file operations.
*/
public void execute(TaskList tasks, Ui ui, Storage storage) {}

/**
* Determines whether this command is an exit command.
* <p>
* Defaults to {@code false}, and only exit commands
* would override this method to return {@code true}.
*
* @return {@code true} if the command should terminate the program, otherwise {@code false}.
*/
public boolean isExit() {
return false;
}
}
49 changes: 49 additions & 0 deletions src/main/java/Deadline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;

/**
* Represents a deadline task with a description, completion status, and deadline date.
* <p>
* The {@code Deadline} class provides methods to mark the task as done,
* unmark it, retrieve its status, and formatting for displaying or saving.
*/
public class Deadline extends Task {
protected String deadline;
protected LocalDate deadlineLocalDate;

public Deadline(String description, String deadline) {
super(description);
this.deadline = deadline;
try {
this.deadlineLocalDate = LocalDate.parse(deadline);
} catch (DateTimeParseException e) {
this.deadlineLocalDate = null;
}

}

/**
* {@inheritDoc}
* This method is inherited from {@link Task}.
* @return A string representation of the task, its description, and deadline date
*/
public String txtSave() {
return "[D]" + super.txtSave() + "|" + deadline;
}

/**
* {@inheritDoc}
* This method is inherited from {@link Task}.
* @return A formatted string representing the task.
*/
@Override
public String toString() {
if (deadlineLocalDate != null) {
String deadlineFormatted = deadlineLocalDate.format(DateTimeFormatter.ofPattern("MMM d yyyy"));
return "[D]" + super.toString() + " (by: " + deadlineFormatted + ")";
} else {
return "[D]" + super.toString() + " (by: " + deadline + ")";
}
}
}
30 changes: 30 additions & 0 deletions src/main/java/DeadlineCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Represents the command to add a deadline task
* <p>
* The {@code DeadlineCommand} creates a new {@code Deadline} task
* with a specified description and a deadline date,
* and adds it to the {@code TaskList}.
*/
public class DeadlineCommand extends Commands {
private final String taskDesc;
private final String deadline;

DeadlineCommand(String taskDesc, String deadline) {
this.taskDesc = taskDesc;
this.deadline = deadline;
}

/**
* Executes the deadline command by creating a {@code Deadline} object,
* adds it to the taskList and displays a confirmation message.
*
* @param tasks The {@code TaskList} containing all tasks.
* @param ui The {@code Ui} for user interaction.
* @param storage The {@code Storage} for file operations.
*/
public void execute(TaskList tasks, Ui ui, Storage storage) {
Deadline t = new Deadline(taskDesc, deadline);
tasks.addTask(t);
ui.formatTaskMsg(t, tasks);
}
}
36 changes: 36 additions & 0 deletions src/main/java/DeleteCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Represents the command to delete a task based on its taskNo from the tasklist
*/
public class DeleteCommand extends Commands {
private final int taskNo;

DeleteCommand(int taskNo) {
this.taskNo = taskNo;
}

/**
* Executes the delete command by removing the specified task from the task list.
* Displays a confirmation message when successfully deleted.
* If the task number is invalid, an error message is displayed instead.
*
* @param tasks The {@code TaskList} containing all tasks.
* @param ui The {@code Ui} for user interaction.
* @param storage The {@code Storage} for file operations.
*/
public void execute(TaskList tasks, Ui ui, Storage storage) {
try {
String reply = " Roger. Task has been removed:\n"
+ " " + tasks.getTask(taskNo).toString() + "\n"
+ " You now have " + (tasks.size()-1) + " tasks in the list.";
ui.formatResponse(reply);
tasks.removeTask(taskNo);
} catch (NullPointerException | IndexOutOfBoundsException e) {
String reply = " Task number not found, reenter with correct task number:";
new MissingCommand(reply).execute(tasks, ui, storage);
} catch (NumberFormatException e) {
String reply = " No task number detected, reenter with correct task number:";
new MissingCommand(reply).execute(tasks, ui, storage);
}

}
}
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

Loading