Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
876151e
Add level 0 increment
irfandeen Jan 21, 2025
e614df3
Remove unused variables in WallE.java
irfandeen Jan 21, 2025
bf9e4bd
Add echo command functionality
irfandeen Feb 2, 2025
290ffb1
Add list to store and list out tasks
irfandeen Feb 2, 2025
90a643a
Add mark and unmark functionality to task list
irfandeen Feb 2, 2025
827efec
Create Task class to represent tasks
irfandeen Feb 2, 2025
7fec201
Modify code to adhere to coding standard
irfandeen Feb 2, 2025
b578e77
Add subclasses extending Task class
irfandeen Feb 11, 2025
a2e877e
Add toString() method to base class
irfandeen Feb 11, 2025
9c6ad3e
Refactor WallE class to improve readability
irfandeen Feb 11, 2025
46c910b
Add try catch for all exceptions
irfandeen Feb 15, 2025
39abee7
Fix toString() methods
irfandeen Feb 15, 2025
1918418
Add error handling
irfandeen Feb 15, 2025
cbafecb
Merge branch 'branch-Level-5'
irfandeen Feb 15, 2025
6578450
Add Wall-E Exception class
irfandeen Feb 15, 2025
5ca2ee5
Refactor code into Wall-E package
irfandeen Feb 15, 2025
03306fb
feature: allow multi-word dates for events and deadlines
irfandeen Feb 21, 2025
bba9299
Refactor Task array into ArrayList for dynamic access
irfandeen Feb 21, 2025
e601a9f
Add delete task functionality
irfandeen Feb 21, 2025
43d21ea
Add file parser. Processing file parser output TBC
irfandeen Feb 22, 2025
45037e0
feature: persistence with text file
irfandeen Feb 22, 2025
34ff431
Merge branch 'branch-Level-6'
irfandeen Feb 22, 2025
0aec5e3
Resolve merge conflicts
irfandeen Feb 22, 2025
43b40c8
Fix bugs arising from ArrayList access
irfandeen Feb 22, 2025
e0c8602
Add JAR manifest
irfandeen Feb 22, 2025
543da72
Refactor to be more modularized. Full functionality not yet restored.
irfandeen Mar 6, 2025
31afe02
Refactor complete. Fully functional and modularized
irfandeen Mar 6, 2025
9e75e32
Add date time functionality to deadline
irfandeen Mar 7, 2025
da8b95b
Fix code style nit
irfandeen Mar 7, 2025
fe47074
Add find functionality to WallE
irfandeen Mar 7, 2025
e6338cd
Add JavaDoc comments for public methods and classes.
irfandeen Mar 7, 2025
826535c
Merge pull request #1 from irfandeen/branch-Level-8
irfandeen Mar 7, 2025
bff51c2
Resolve conflicts between Find functionality and DateTime functionality
irfandeen Mar 7, 2025
0f2aa02
Merge pull request #2 from irfandeen/branch-Level-9
irfandeen Mar 7, 2025
300372a
Resolve conflicts between master and JavaDoc branch
irfandeen Mar 7, 2025
a1a16ed
Merge pull request #3 from irfandeen/branch-A-JavaDoc
irfandeen Mar 7, 2025
d13d5bd
Add Readme.md
irfandeen Mar 7, 2025
a106526
Fix bugs with deadline command
irfandeen Mar 12, 2025
642d36b
Add input into UserInterface class
irfandeen Mar 12, 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Duke project template
# WallE project template

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.

Expand All @@ -13,7 +13,7 @@ Prerequisites: JDK 17, update Intellij to the most recent version.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 17** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
1. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
1. After that, locate the `src/main/java/WallE.java` file, right-click it, and choose `Run WallE.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
```
Hello from
____ _
Expand Down
6 changes: 6 additions & 0 deletions data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1,T,some stuff
0,E,coldplay concert,evening,night
1,D,submit stuff,2025-05-05,18:00
1,D,assignment submission,2025-03-03,23:59
0,E,CCA,evening,night
0,D,submit JAR release,2023-03-15,23:59
151 changes: 137 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,153 @@
# Duke User Guide

// Update the title above to match the actual product name
# Wall-E User Guide

// Product screenshot goes here
![Screenshot of sample Wall-E Usage](assets/WallE-Screenshot.png)

// Product intro goes here
**Product Overview**
Wall-E is a task management application designed to help you organize and keep track of your tasks with ease.
You can add todo items, set deadlines, events, and mark tasks as done or not done. The app will save your tasks in a file and retrieve them when you restart it.

## Adding deadlines
---
## Adding Todo Tasks

// Describe the action and its outcome.
To add a todo task, simply use the `todo` command followed by the task description.

// Give examples of usage
### Example: `todo mop the floor`

Example: `keyword (optional arguments)`
**Expected Outcome:**
This will add a task called "mop the floor" and initialize it as incomplete. It has a "T" type to indicate it is a todo task.

// A description of the expected outcome goes here
```
added: [T][ ] mop the floor
```

---
## Adding Deadlines

To add a task with a deadline, simply use the `deadline` command followed by the task description and the due date and time.
The task command *expects* a valid date and time of the format yyyy-MM-dd HHmm in 24 hour format.

### Example: `deadline finish project /by 2025-03-10 1600`

**Expected Outcome:**
This will add a task named "finish project" with the deadline of March 10, 2025, 4.00pm. It will be displayed in your task list with the type "D" for Deadline.

```
added: [D][ ] finish project (by: 2025-03-10 4.00 pm)
```

---
## Adding Events

You can add an event using the `event` command, providing the task description and the start and end dates.

### Example: `event team meeting /from 9am /to around 12pm`

**Expected Outcome:**
This adds an event for "team meeting" that spans from "9am" to "around 12pm". Event does not differentiate between
real dates and text input.

```
added: [E][ ] team meeting (from: 2025-03-01, to: 2025-03-02)
```

---

## Marking Tasks as Done

You can mark any task as completed by using the `mark` command followed by the task number.

### Example: `mark 1`

**Expected Outcome:**
The task with the specified number will be marked as done.

```
Nice! I've marked this task as done:
[D][X] finish project (by: 2025-03-10)
```

---

## Unmarking Tasks

If you wish to unmark a task that was previously marked as done, use the `unmark` command followed by the task number.

### Example: `unmark 1`

**Expected Outcome:**
The task will be unmarked as done.

```
expected output
OK, I've marked this task as not done yet:
[D][ ] finish project (by: 2025-03-10)
```

## Feature ABC
---

// Feature details
## Deleting Tasks

If you no longer need a task, you can delete it using the `delete` command followed by the task number.

### Example: `delete 2`

**Expected Outcome:**
The task with the specified index will be removed from the task list.

```
deleted task: [T][ ] Buy groceries
```

---

## Listing All Tasks

To view all the tasks currently in your list, use the `list` command.

### Example: `list`

**Expected Outcome:**
This will display all the tasks currently stored in your list.

```
Here are the tasks in your list:
1. [D][ ] finish project (by: 2025-03-10)
2. [E][ ] team meeting (from: 2025-03-01, to: 2025-03-02)
```

---

## Find By Keyword or Phrase

To find tasks that contain some keyword or phrase, use the `find` command.

### Example: `find homework`

**Expected Outcome:**
This will display tasks that contain the provided search term(s).

```
Results of find command:
1. [D][ ] do homework (by: 2025-03-10)
2. [E][ ] submit cs2113 homework (from: 2025-03-01, to: 2025-03-02)
```

---

## Exit the Application

To close the Wall-E application and save your tasks, use the `bye` command.

### Example: `bye`

**Expected Outcome:**
Wall-E will save the tasks to the file and print an exit message.

```
Saved data to data.txt
Bye. Hope to see you again soon!
```

## Feature XYZ
---

// Feature details
This is your guide to using the Wall-E application. Enjoy organizing your tasks with ease!
Binary file added docs/assets/WallE-Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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: walle.WallE

119 changes: 119 additions & 0 deletions src/main/java/walle/Storage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
package walle;

import walle.task.Deadline;
import walle.task.Event;
import walle.task.Task;
import walle.task.Todo;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

/**
* Handles reading from and writing to a storage file for tasks.
* Provides methods to load tasks from a file and save tasks to a file.
*/
public class Storage {
private File file;

/**
* Reads the contents of the specified file and loads tasks into the provided list.
*
* @param filePath The path to the file to read from.
* @param tasks The list to store the loaded tasks.
* @return The number of tasks read from the file.
* @throws FileNotFoundException If the file cannot be found.
*/
public int readFileContents(String filePath, ArrayList<Task> tasks) throws FileNotFoundException {
Scanner scanner = new Scanner(file);
int listSize = 0;
while (scanner.hasNext()) {
String[] taskString = scanner.nextLine().split(",");
boolean isDone = taskString[0].equals("1") ? true : false;
String taskType = taskString[1];
String taskDescription = taskString[2];

if (taskType.equals("T")) {
tasks.add(new Todo(taskDescription));
} else if (taskType.equals("D")) {
String dueDate = taskString[3];
String dueTime = taskString[4];
tasks.add(new Deadline(taskDescription, dueDate, dueTime));
} else if (taskType.equals("E")) {
String fromDate = taskString[3];
String toDate = taskString[4];
tasks.add(new Event(taskDescription, fromDate, toDate));
}

if (isDone) {
tasks.get(listSize).markAsDone();
}

listSize++;
}
scanner.close();
return listSize;
}

private void createFile(String filePath) {
try {
File tempFile = new File(filePath);
if (tempFile.createNewFile()) {
System.out.println("File created: " + tempFile.getName());
FileWriter writer = new FileWriter(tempFile);
writer.close();
} else {
System.out.println("File already exists.");
}
} catch (IOException e) {
System.out.println("An error occurred while creating the file.");
}
}

/**
* Instantiate storage functionality by providing relative file path to stored data.
* Creates a new file if file does not exist.
*
* @param filePath Relative path to the data file to read from.
*/
public Storage(String filePath) {
file = new File(filePath);
if (!file.exists()) {
createFile(filePath);
}
}

/**
* Saves the tasks to the file at the specified path.
*
* @param filePath The path to the file to save to.
* @param tasks The list of tasks to save.
* @param listSize The number of tasks to save.
*/
public void saveToFile(String filePath, ArrayList<Task> tasks, int listSize) {
try {
FileWriter writer = new FileWriter(file);
for (int i = 0; i < listSize; i++) {
Task t = tasks.get(i);
String status = t.isDone() ? "1" : "0";
writer.write(status + "," + t.getTypeIcon() + "," + t.getDescription());
if (t.getTypeIcon() == "T") {
writer.write("\n");
} else if (t.getTypeIcon() == "D") {
Deadline d = (Deadline) t;
writer.write("," + d.getDueDate() + "," + d.getDueTime() + "\n");
} else if (t.getTypeIcon() == "E") {
Event e = (Event) t;
writer.write("," + e.getStartDate() + "," + e.getEndDate() + "\n");
}
}
writer.close();
} catch (Exception e) {
System.out.println("An error occurred while saving the file.");
System.out.println(e.getMessage());
}
}
}
Loading