Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ab76983
Level-0 Increment, Greet and Exit message
SpeciLiam Jan 27, 2023
66f05b6
Level 1. Greet, Echo, Exit
SpeciLiam Jan 27, 2023
326cf60
Level 2. Add, List
SpeciLiam Jan 27, 2023
e77c524
LevevlLevel 3. Mark as Done
SpeciLiam Jan 31, 2023
2cc0131
A-CodingStandard
SpeciLiam Jan 31, 2023
489244b
Level 4. ToDos, Events, Deadlines
SpeciLiam Feb 2, 2023
9cc6ba3
A-CodeQuality
SpeciLiam Feb 2, 2023
9939b56
added class DukeException.java and switched from if statement structu…
SpeciLiam Feb 8, 2023
c8898cc
Added exception handling for todo and unknown command
SpeciLiam Feb 9, 2023
c233d69
A-Packages
SpeciLiam Feb 9, 2023
a760d20
Level 6. Delete
SpeciLiam Feb 15, 2023
238fb85
adding File Paths_1
SpeciLiam Feb 15, 2023
acd898a
Level 7. Save
SpeciLiam Feb 15, 2023
6940bc1
Merge branch 'branch-Level-6' into branch-Level-7
SpeciLiam Feb 15, 2023
96b58be
Changes for code readibility
SpeciLiam Feb 15, 2023
804bf2e
Merge Conflicts with branch 6 and 7
SpeciLiam Feb 15, 2023
d9dc7c1
Code Cleanup
SpeciLiam Feb 15, 2023
99237ca
A-MoreOOP
SpeciLiam Mar 2, 2023
f9bb7fe
Code Cleanup
SpeciLiam Mar 3, 2023
73543ab
Level 9. Find and code clean up
SpeciLiam Mar 3, 2023
cef26a2
Code Cleanup
SpeciLiam Mar 3, 2023
5886c71
A-JavaDoc
SpeciLiam Mar 3, 2023
c12849d
A-UserGuide
SpeciLiam Mar 3, 2023
eee98c8
Code clean-up and error handling better
SpeciLiam Mar 3, 2023
1b6cb39
Coding Standard Upkeep
SpeciLiam Mar 3, 2023
c222d8e
Commiting for jar related issues - made a change in code so that I ca…
SpeciLiam Mar 4, 2023
660cda3
Commiting for jar related issues - made a change in code so that I ca…
SpeciLiam Mar 4, 2023
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
241 changes: 233 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,253 @@

## Features

### Feature-ABC
### Feature-todo

Description of the feature.
You can use this to create a new todo task with a description.

### Feature-XYZ
### Feature-deadline

Description of the feature.
You can use this to create a new deadline task with a description and a due by date.

### Feature-event

You can use this to create a new event task with a description and a /from time and a /to time.

### Feature-list

You can use this to list out all of the tasks, which will display if in order of and if it is marked as done.

### Feature-mark

You can use this feature to mark a task as done for good up-keeping.

### Feature-unmark

You can use this feature to un-mark a task as done for good up-keeping.

### Feature-delete

You can use this feature to remove a task from the list.

### Feature-find

You can use this feature to list out all of the tasks that match with a specified term.

### Feature-Automatic Saving

All modifications using the aforementioned features will be saved to your device in a text file automatically.

## Usage

### `Keyword` - Describe action
### `Keyword` - todo

Describe the action and its outcome.
Add a general task without a time frame.

Example of usage:

`keyword (optional arguments)`
`todo take out the trash`

Expected outcome:
```
____________________________________________________________
todo take out the trash
____________________________________________________________
Got it. I've added this task:
[T][ ] take out the trash
Now you have 1 tasks in the list.
____________________________________________________________
Successfully wrote to the file.
____________________________________________________________
```

Description of the outcome.
```
Reads in the todo and stores it in a list and saves to the file.
```

### `Keyword` - deadline

Add a task with a deadlione.

Example of usage:

`deadline take out the trash /by 7pm`

Expected outcome:
```
____________________________________________________________
deadline take out the trash /by 7pm
____________________________________________________________
take out the trash /by 7pm
Got it. I've added this task:
[D][ ] take out the trash (by: 7pm)
Now you have 2 tasks in the list.
____________________________________________________________
Successfully wrote to the file.
____________________________________________________________

```

Description of the outcome.
```
Reads in the deadline and stores it in a list and saves to the file.
```

### `Keyword` - event

Add a task with a deadlione.

Example of usage:

`event take out the trash /from 8am /to 10am`

Expected outcome:
```
____________________________________________________________
Got it. I've added this task:
[E][ ] take out the trash (from: 8am to: 10am)
Now you have 3 tasks in the list.
____________________________________________________________
Successfully wrote to the file.
____________________________________________________________

```

Description of the outcome.
```
Reads in the event and stores it in a list and saves to the file.
```

### `Keyword` - list

Lists out all the entered in tasks and tasks loaded in at start.

Example of usage:

`list`

Expected outcome:
```
list
____________________________________________________________
Here are the tasks in your list:
1.[T][ ] take out the trash
2.[D][ ] take out the trash (by: 7pm)
3.[E][ ] take out the trash (from: 8am to: 10am)
____________________________________________________________

```

Description of the outcome.
```
Lists out all the taskst with their descriptions, times, and if they are marked done or not.
```

### `Keyword` - mark

Mark a task as done.

Example of usage:

`mark 3`

Expected outcome:
```
mark 3
____________________________________________________________
Nice! I've marked this task as done:
[E][X] take out the trash (from: 8am to: 10am)
____________________________________________________________
Successfully wrote to the file.
____________________________________________________________

```

Description of the outcome.
```
Marked the task as done and displayed the marked task now denoted with '[X]'
```
### `Keyword` - unmark

unmark a task as not done.

Example of usage:

`unmark 3`

Expected outcome:
```
unmark 3
____________________________________________________________
OK, I've marked this task as not done yet:
[E][ ] take out the trash (from: 8am to: 10am)
____________________________________________________________
Successfully wrote to the file.
____________________________________________________________

```

Description of the outcome.
```
Marked the task as NOT done and displayed the marked task now denoted with '[ ]'
```
expected output

### `Keyword` - delete

removes a task from the list from a specified index

Example of usage:

`delete 3`

Expected outcome:
```
delete 3
____________________________________________________________
Noted. I've removed this task:
take out the trash
Now you have 2 tasks in the list.
____________________________________________________________
Successfully wrote to the file.
____________________________________________________________

```

Description of the outcome.
```
Deletes the specified task from the list. Echos what task it was. Resaves to the file because it was now changed.
```

### `Keyword` - find

lists out all the tasks that match a specified term.

Example of usage:

`find trash`

Expected outcome:
```
list
____________________________________________________________
Here are the tasks in your list:
1.[T][ ] take out the trash
2.[D][ ] take out the trash (by: 7pm)
3.[T][ ] find a book
____________________________________________________________
find trash
____________________________________________________________
____________________________________________________________
Here are the matching tasks in your list:

[T][ ] take out the trash
[D][ ] take out the trash (by: 7pm)
____________________________________________________________


```

Description of the outcome.
```
Finds all the tasks that match the specified query and lists them out.
```
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

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: duke.Duke

64 changes: 64 additions & 0 deletions src/main/java/duke/Commands/Command.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package duke.Commands;

import duke.TaskList;
import dukeException.DukeException;
import tasks.Task;

import static duke.Duke.LINE_SPACING;

/**
* The Command class is an abstract class that serves
* as the base class for all types of commands in Duke.
*/
public class Command {

/**
* The list of tasks in Duke.
*/
protected TaskList tasks = new TaskList();

/**
* A boolean flag that indicates whether the program should exit.
*/
protected boolean isExit = false;

/**
* Prints a message indicating that a task has been added to the task list.
*
* @param tasks The list of tasks in Duke.
* @param tsk The task that was added to the list.
*/
public static void addTaskPrint(TaskList tasks, Task tsk) {
System.out.println("\tGot it. I've added this task:");
System.out.println("\t " + tsk.toString());
System.out.println("\tNow you have " + tasks.getSize() + " tasks in the list.");
}

/**
* Retrieves the task at the specified index in the list of tasks.
*
* @param idx The index of the task to retrieve.
* @return The task at the specified index.
*/
public Task getTask(int idx) {
return tasks.getTask(idx);
}

/**
* Executes the command.
*
* @throws DukeException If an error occurs while executing the command.
*/
public void cmd() throws DukeException {
System.out.println("Please enter in a valid command.");
}

/**
* Returns a boolean flag indicating whether the program should exit.
*
* @return A boolean flag indicating whether the program should exit.
*/
public boolean getExit() {
return isExit;
}
}
Loading