diff --git a/.gitignore b/.gitignore
index 99712178bf..6290f75380 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,14 @@
-# IDEA files
-/.idea/
-/out/
-/*.iml
-
-# Gradle build files
-/.gradle/
-/build/
-src/main/resources/docs/
-
-# MacOS custom attributes files created by Finder
-.DS_Store
-*.iml
-bin/
+# IDEA files
+/.idea/
+/out/
+/*.iml
+
+# Gradle build files
+/.gradle/
+/build/
+src/main/resources/docs/
+
+# MacOS custom attributes files created by Finder
+.DS_Store
+*.iml
+bin/
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 8e359a0145..419450f2f6 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -1,9 +1,9 @@
-# Contributors
-
-Display | Name | Github Profile | Homepage
----|:---:|:---:|:---:
- | Jeffry Lum | [Github](https://github.com/j-lum/) | [Homepage](https://se.kasugano.moe)
- | Damith C. Rajapakse | [Github](https://github.com/damithc/) | [Homepage](https://www.comp.nus.edu.sg/~damithch/)
-# I would like to join this list. How can I help the project
-
-For more information, please refer to our [contributor's guide](https://oss-generic.github.io/process/).
+# Contributors
+
+Display | Name | Github Profile | Homepage
+---|:---:|:---:|:---:
+ | Jeffry Lum | [Github](https://github.com/j-lum/) | [Homepage](https://se.kasugano.moe)
+ | Damith C. Rajapakse | [Github](https://github.com/damithc/) | [Homepage](https://www.comp.nus.edu.sg/~damithch/)
+# I would like to join this list. How can I help the project
+
+For more information, please refer to our [contributor's guide](https://oss-generic.github.io/process/).
diff --git a/README.md b/README.md
index d0168724c3..1dd878b00a 100644
--- a/README.md
+++ b/README.md
@@ -1,39 +1,39 @@
-# Setting up
-
-**Prerequisites**
-
-* JDK 11
-* Recommended: IntelliJ IDE
-* Fork this repo to your GitHub account and clone the fork to your computer
-
-**Importing the project into IntelliJ**
-
-1. Open IntelliJ (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project dialog first).
-1. Set up the correct JDK version.
- * Click `Configure` > `Structure for new Projects` (in older versions of Intellij:`Configure` > `Project Defaults` > `Project Structure`).
- * If JDK 11 is listed in the drop down, select it. If it is not, click `New...` and select the directory where you installed JDK 11.
- * Click `OK`.
-1. Click `Import Project`.
-1. Locate the project directory and click `OK`.
-1. Select `Create project from existing sources` and click `Next`.
-1. Rename the project if you want. Click `Next`.
-1. Ensure that your src folder is checked. Keep clicking `Next`.
-1. Click `Finish`.
-
-# Tutorials
-
-duke.duke Increment | Tutorial
----------------|---------------
-`A-Gradle` | [Gradle Tutorial](tutorials/gradleTutorial.md)
-`A-TextUiTesting` | [Text duke.UI Testing Tutorial](tutorials/textUiTestingTutorial.md)
-`Level-10` | JavaFX tutorials:
→ [Part 1: Introduction to JavaFX][fx1]
→ [Part 2: Creating a GUI for duke.duke][fx2]
→ [Part 3: Interacting with the user][fx3]
→ [Part 4: Introduction to FXML][fx4]
-
-[fx1]:
-[fx2]:
-[fx3]:
-[fx4]:
-
-# Feedback, Bug Reports
-
-* If you have feedback or bug reports, please post in [se-edu/duke issue tracker](https://github.com/se-edu/duke/issues).
+# Setting up
+
+**Prerequisites**
+
+* JDK 11
+* Recommended: IntelliJ IDE
+* Fork this repo to your GitHub account and clone the fork to your computer
+
+**Importing the project into IntelliJ**
+
+1. Open IntelliJ (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project dialog first).
+1. Set up the correct JDK version.
+ * Click `Configure` > `Structure for new Projects` (in older versions of Intellij:`Configure` > `Project Defaults` > `Project Structure`).
+ * If JDK 11 is listed in the drop down, select it. If it is not, click `New...` and select the directory where you installed JDK 11.
+ * Click `OK`.
+1. Click `Import Project`.
+1. Locate the project directory and click `OK`.
+1. Select `Create project from existing sources` and click `Next`.
+1. Rename the project if you want. Click `Next`.
+1. Ensure that your src folder is checked. Keep clicking `Next`.
+1. Click `Finish`.
+
+# Tutorials
+
+duke.duke Increment | Tutorial
+---------------|---------------
+`A-Gradle` | [Gradle Tutorial](tutorials/gradleTutorial.md)
+`A-TextUiTesting` | [Text duke.UI Testing Tutorial](tutorials/textUiTestingTutorial.md)
+`Level-10` | JavaFX tutorials:
→ [Part 1: Introduction to JavaFX][fx1]
→ [Part 2: Creating a GUI for duke.duke][fx2]
→ [Part 3: Interacting with the user][fx3]
→ [Part 4: Introduction to FXML][fx4]
+
+[fx1]:
+[fx2]:
+[fx3]:
+[fx4]:
+
+# Feedback, Bug Reports
+
+* If you have feedback or bug reports, please post in [se-edu/duke issue tracker](https://github.com/se-edu/duke/issues).
* We welcome pull requests too.
\ No newline at end of file
diff --git a/Updates.txt b/Updates.txt
index c2d09cfd1d..6527615691 100644
--- a/Updates.txt
+++ b/Updates.txt
@@ -1,242 +1,248 @@
-Here is the list of updates written for each commit:
-
-20/1/20 Level 1-1:
-Created:
-Your basic level 1 echo
-Added personality
-Added Dictionary for commands(Hash)
-Created commands.CommandHub
-Created Invoker to invoke the commands
-Used interface to define usercommands
-
-21/1/20
-Level 2
-Created:
-Your basic level 2 code
-Added list
-Made task as objects
-Commandhub now returns add as default
-Added list as a valid command to commandhub
-
-database.MyList:
-Added additem function
-Changed strings to tasks
-Print list made static
-
-Level 3
-Created:
-Done command
-Edited commandhub to notice done events
-Set tasks to have done ticks
-
-Changes:
-Commandhub:
-notice done events now
-
-Mylist:
-Added markdone function
-Added delete function (Incomplete)
-Added push function (Incomplete)
-
-Level 4
-Added events, todo, deadline undertask
-
-Changes:
-commands.CommandHub:
-Allow seperation of commands
-
-
-Add_Commands:
-Added types
-
-Level 5
-Created exceptions.DukeException
-
-Changes:
-Main:
-Added catching of exception
-CommandHUb:
-Throw Exception for empty todo and invalid command
-Throws Exception for empty or missing /by or /at command
-Possible: Check for missing desc for event and deadline commands and non integer for delete and done
-
-Level 6
-Added Delete function
-
-26/1/20
-Level 7:
-Added load command
-Added botmemory
-Now bot has init
-
-Level 7-1:
-Fixed markdone
-May have issues with formatting
-
-Git Note:
-Bot does not check commit tags.
-
-
-Level 8-1:
-Added dateTime class - Returns date/time objects
-Added dateTime handler -handles parsing of data and time, able to print and return proper datetime objects.. returns null if not correct
-
-Changes:
-Changed event/deadline tasks strings to localdatetime class objects
-Change event/deadline tostring method to print localdatetime objects
-
-Issues:
-Memory does not sync
-
-Updates:
-- Possible for duke to accept non time/date sentences? (Not implemented)
-
-
-2/2/20
-
-Level 8-2:
-Merged master with branch 8 and 7
-
-Issues
-Memory does not print properly - editied parsedesc
-Does not accepts date with no time (memory save error
- -Error messgae:
- Exception in thread "main" java.time.format.DateTimeParseException: Text '20 Mar 2040' could not be parsed at index 11
- at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046)
- at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1948)
- at java.base/java.time.LocalDateTime.parse(LocalDateTime.java:492)
- at resources.DateTimeHandler.revertDateTime(resources.DateTimeHandler.java:72)
- at Bot_Memory.parseDesc(Bot_Memory.java:107)
- at Bot_Memory.saveMemory(Bot_Memory.java:65)
- at Bye_Command.action(Bye_Command.java:15)
- at commands.CommandInvoker.Invoke(commands.CommandInvoker.java:17)
- at duke.duke.main(duke.duke.java:12)
- - Fixed by return localdate due to function not acceepting non time (LocalDateTime)
- - Fixed by accepting single digit numbers
-
-Datetime does not recognise if user type in single digit dates (3/03/2020)
-
-
-3/2/20
-A-More OOP
-Added duke.UI class
-
-
-
-A-JavaDocs
-Added Java Docs
-
-
-A-Packages
-Sorted files based on packages
-
-Issues:
-Does not update file if list is empty
- - Edited the savememory function to append "wow much empty" to file if lsit is empty
- - Edited the load memory to ignore "wow much emptiness"
-
-
-Level-9
-Added findcommand
-
-Changes:
-Edited CommandHub to accept find commands
-
-Issues:
-Find command unable to detect dates in english format
-
-
-8/2/20
-A-CodingStandards
-Fixed some coding standards formats
-
-
-A-Gradle
-Added Gradle support
-Included Shadow Jar
-
-
-9/2/20
-
-A-GUI
-Added GUI (Tutorial)
-
-Stage 2:
-added some sort of integration to bot
-
-Issues:
-Majority function is not working
- Known issues:
- == Commands ==
- - bye command: How to fix?
- Needs to save the memory
- Turn off application
- - list command: Unable to print out list
- - Find command: Unable to print "Here are task found"
- - Added Command: Does not show the number of list printed
- == Features ==
- - Memory not saved
- - Some part of bot speech is not printed
-
-
-Update 2-1:
-Fixes to issues
-
-Fixes:
-- ByeCommand/ListCommand:
- Fix by initialising bot (Forgot)
-- ListCommand:
- Corrected the print
-- Bye_Command:
- Fixed save memory
- Application can now turn off : System.exit(0)
- Suggested implementation: Bot does not print good bye statement
-
-Update 2-2:
-Added welcome message from bot
-Added Background image
-Added button(red)
-
-Issues:
-Some formating errors:
- - List does not display nicely
-
-Unfixed Issus:
- - Does not show some output for commands (Speech not print)
-
-Update 2-3
-Added icon
-Changed Pics (Duke and user)
-Added instructions
-
-Fixes:
-- Fixed find event
-
-10/02/20
-A-Statistics
-
-
-Show what is done in this week
-
-
-Remember to save all these into memory
-
-Issues:
-Remind user to say bye to save memory (Not fixed)
-
-A-CodeQuality
-Added java docs
-Fixed some code format error
-
-
-C-Statistics/A-Sort
-Update 1-1
-Added stats for showing number of types (inputs)
-Count the number of task done today
-Number of task deleted in session
-Get Expired Tasks
-
-Things maybe wanted to implement
-2. Time bot has been running
-Seperate usercommands
-
+Here is the list of updates written for each commit:
+
+20/1/20 Level 1-1:
+Created:
+Your basic level 1 echo
+Added personality
+Added Dictionary for commands(Hash)
+Created commands.CommandHub
+Created Invoker to invoke the commands
+Used interface to define usercommands
+
+21/1/20
+Level 2
+Created:
+Your basic level 2 code
+Added list
+Made task as objects
+Commandhub now returns add as default
+Added list as a valid command to commandhub
+
+database.MyList:
+Added additem function
+Changed strings to tasks
+Print list made static
+
+Level 3
+Created:
+Done command
+Edited commandhub to notice done events
+Set tasks to have done ticks
+
+Changes:
+Commandhub:
+notice done events now
+
+Mylist:
+Added markdone function
+Added delete function (Incomplete)
+Added push function (Incomplete)
+
+Level 4
+Added events, todo, deadline undertask
+
+Changes:
+commands.CommandHub:
+Allow seperation of commands
+
+
+Add_Commands:
+Added types
+
+Level 5
+Created exceptions.DukeException
+
+Changes:
+Main:
+Added catching of exception
+CommandHUb:
+Throw Exception for empty todo and invalid command
+Throws Exception for empty or missing /by or /at command
+Possible: Check for missing desc for event and deadline commands and non integer for delete and done
+
+Level 6
+Added Delete function
+
+26/1/20
+Level 7:
+Added load command
+Added botmemory
+Now bot has init
+
+Level 7-1:
+Fixed markdone
+May have issues with formatting
+
+Git Note:
+Bot does not check commit tags.
+
+
+Level 8-1:
+Added dateTime class - Returns date/time objects
+Added dateTime handler -handles parsing of data and time, able to print and return proper datetime objects.. returns null if not correct
+
+Changes:
+Changed event/deadline tasks strings to localdatetime class objects
+Change event/deadline tostring method to print localdatetime objects
+
+Issues:
+Memory does not sync
+
+Updates:
+- Possible for duke to accept non time/date sentences? (Not implemented)
+
+
+2/2/20
+
+Level 8-2:
+Merged master with branch 8 and 7
+
+Issues
+Memory does not print properly - editied parsedesc
+Does not accepts date with no time (memory save error
+ -Error messgae:
+ Exception in thread "main" java.time.format.DateTimeParseException: Text '20 Mar 2040' could not be parsed at index 11
+ at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046)
+ at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1948)
+ at java.base/java.time.LocalDateTime.parse(LocalDateTime.java:492)
+ at resources.DateTimeHandler.revertDateTime(resources.DateTimeHandler.java:72)
+ at Bot_Memory.parseDesc(Bot_Memory.java:107)
+ at Bot_Memory.saveMemory(Bot_Memory.java:65)
+ at Bye_Command.action(Bye_Command.java:15)
+ at commands.CommandInvoker.Invoke(commands.CommandInvoker.java:17)
+ at duke.duke.main(duke.duke.java:12)
+ - Fixed by return localdate due to function not acceepting non time (LocalDateTime)
+ - Fixed by accepting single digit numbers
+
+Datetime does not recognise if user type in single digit dates (3/03/2020)
+
+
+3/2/20
+A-More OOP
+Added duke.UI class
+
+
+
+A-JavaDocs
+Added Java Docs
+
+
+A-Packages
+Sorted files based on packages
+
+Issues:
+Does not update file if list is empty
+ - Edited the savememory function to append "wow much empty" to file if lsit is empty
+ - Edited the load memory to ignore "wow much emptiness"
+
+
+Level-9
+Added findcommand
+
+Changes:
+Edited CommandHub to accept find commands
+
+Issues:
+Find command unable to detect dates in english format
+
+
+8/2/20
+A-CodingStandards
+Fixed some coding standards formats
+
+
+A-Gradle
+Added Gradle support
+Included Shadow Jar
+
+
+9/2/20
+
+A-GUI
+Added GUI (Tutorial)
+
+Stage 2:
+added some sort of integration to bot
+
+Issues:
+Majority function is not working
+ Known issues:
+ == Commands ==
+ - bye command: How to fix?
+ Needs to save the memory
+ Turn off application
+ - list command: Unable to print out list
+ - Find command: Unable to print "Here are task found"
+ - Added Command: Does not show the number of list printed
+ == Features ==
+ - Memory not saved
+ - Some part of bot speech is not printed
+
+
+Update 2-1:
+Fixes to issues
+
+Fixes:
+- ByeCommand/ListCommand:
+ Fix by initialising bot (Forgot)
+- ListCommand:
+ Corrected the print
+- Bye_Command:
+ Fixed save memory
+ Application can now turn off : System.exit(0)
+ Suggested implementation: Bot does not print good bye statement
+
+Update 2-2:
+Added welcome message from bot
+Added Background image
+Added button(red)
+
+Issues:
+Some formating errors:
+ - List does not display nicely
+
+Unfixed Issus:
+ - Does not show some output for commands (Speech not print)
+
+Update 2-3
+Added icon
+Changed Pics (Duke and user)
+Added instructions
+
+Fixes:
+- Fixed find event
+
+10/02/20
+A-Statistics
+
+
+Show what is done in this week
+
+
+Remember to save all these into memory
+
+Issues:
+Remind user to say bye to save memory (Not fixed)
+
+A-CodeQuality
+Added java docs
+Fixed some code format error
+
+
+C-Statistics/A-Sort
+Update 1-1
+Added stats for showing number of types (inputs)
+Count the number of task done today
+Number of task deleted in session
+Get Expired Tasks
+
+Things maybe wanted to implement
+2. Time bot has been running
+Seperate usercommands
+
+
+Bug fixes
+Update 1-1
+Fix bug where bot dont save memory when closed
+Fix bug where cannot see past certain amount of items
+
diff --git a/build.gradle b/build.gradle
index 904af68a03..1fc3389bd8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,46 +1,55 @@
-plugins {
- id 'java'
- id 'application'
- id 'com.github.johnrengelman.shadow' version '5.1.0'
- id 'org.openjfx.javafxplugin' version '0.0.7'
- id 'checkstyle'
-}
-
-group 'seedu.duke'
-version '0.1.0'
-
-javafx {
- version = "11.0.2"
- modules = [ 'javafx.controls', 'javafx.fxml' ]
-}
-
-repositories {
- mavenCentral()
-}
-
-dependencies {
- testImplementation 'org.junit.jupiter:junit-jupiter:5.5.0'
-}
-shadowJar {
- archiveBaseName = "duke"
- archiveVersion = "0.1.3"
- archiveClassifier = null
- archiveAppendix = null
-}
-
-checkstyle {
- toolVersion = '8.23'
-}
-
-test {
- useJUnitPlatform()
-}
-
-application {
- // Change this to your main class.
- mainClassName = "duke.Launcher"
-}
-
-run {
- standardInput = System.in
+plugins {
+ id 'java'
+ id 'application'
+ id 'com.github.johnrengelman.shadow' version '5.1.0'
+ id 'org.openjfx.javafxplugin' version '0.0.7'
+ id 'checkstyle'
+}
+
+group 'seedu.duke'
+version '0.1.0'
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.5.0'
+ String javaFxVersion = '11'
+
+ implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win'
+ implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac'
+ implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'linux'
+ implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'win'
+ implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'mac'
+ implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'linux'
+ implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'win'
+ implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'mac'
+ implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'linux'
+ implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win'
+ implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac'
+ implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux'
+}
+shadowJar {
+ archiveBaseName = "duke"
+ archiveVersion = "0.1.3"
+ archiveClassifier = null
+ archiveAppendix = null
+}
+
+checkstyle {
+ toolVersion = '8.23'
+}
+
+test {
+ useJUnitPlatform()
+}
+
+application {
+ // Change this to your main class.
+ mainClassName = "duke.Launcher"
+}
+
+run {
+ standardInput = System.in
}
\ No newline at end of file
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index b1a57ba6c0..f8fd7bdfad 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -1,257 +1,257 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/README.md b/docs/README.md
index 6200c5ad6a..f798c7862f 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,149 +1,175 @@
-# User Guide
-
-##What is Duke?
-Duke is a task bot build to keep track of all your task and schedules.
-Users can add and delete their tasks and Duke will keep track of all your task for you.
-
-##Who is Yuri?
-
-Yuri is personality build on top of Duke, the original bot. Yuri aims to ensure that you as a user understand her pain of keeping track of all your task. Even thou she is supposed to track the task for you, she will not hesitate to express her displeasure at your laziness and irresponsibility in handling your own to do list.
-
-## Installing the Software
-Navigate to [github Releases](https://github.com/Deunitato/duke/releases) and download the latest release. Place the jar file into a new folder.
-Opening the Jar file will show a welcome text from YURI.
-![Image of startup] (https://i.imgur.com/WZ1yERF.png)
-
-## Features
-
-### Add and delete
-Add your own tasks/deadlines/events
-
-### List your own tasks
-Ask Yuri to display the task that you have to do
-
-### Check your statistic
-Yuri will also keep track of things that you did within the day and week.
-
-### Tsundere Personality
-Yuri will "hate" your laziness but still feel compled to serve you as your personal secretary.
-
-
-## Usage
-
-Basic Usage of Yuri
-
-### `bye` - Saves Yuri memory
-Yuri requires you to say bye for her to remember what you say.
-
-Example of usage:
-
-`bye`
-
-
-### `TODO` - Creates an todo task
-
-Adds a TODO Tasks into your list
-
-Example of usage:
-
-`Todo Read Book`
-
-Expected outcome:
-
-`sighs...am I your slave again?`
-
-### `Event` - Creates an event task
-
-Creates a event and adds it into your list
-Yuri also requires the date of the event as denoted by /at
-
-Example of usage:
-
-`event Anime Matsuri /at 12-01-2020`
-
-Expected outcome:
-
-`sighs...am I your slave again?`
-
-### `Deadline` - Creates an deadline
-
-Creates a deadline and adds it into your list
-Yuri also requires the date of the event as denoted by /by
-
-Example of usage:
-
-`event Homework /at 12-01-2020`
-
-Expected outcome:
-
-`sighs...am I your slave again?`
-
-### `list` - Shows your list bucket
-
-Displays the list of task that you current have.
-
-Example of usage:
-
-`list`
-
-
-### `Done` - Marks task as done
-
-Marks the task signified by ID as done
-
-Example of usage:
-
-`done 1`
-
-Expected outcome:
-
-`Okay whatever.. so you have completed this item.. so what? Marking item 1 as done `
-
-### `Stats` - List out all the stats command
-
-Shows the list of stats command you could use.
-Examples are
- 1. Expired - list all the expired tasks
- 2. Week - List the tasks you have completed in the week
-
-Example of usage:
-
-`stats`
-
-### `Find` - Searches for a task
-
-Searches for tasks in your list
-
-Example of usage:
-
-`find home`
-
-Expected outcome:
-`Found this task in total:`
-` 1. [T][X] Homework`
-`Found in total 1 tasks`
-
-### `Delete` - Deletes your task
-
-Totally remove all records of your tasks
-
-Example of usage:
-
-`delete 1`
-
-Expected outcome:
-
-`Erasing your tracks are you?`
-
-
-#Sample Screenshots of Yuri
-
-## Adding Tasks
-
-
-
-## Finding of Tasks
-
-
-## Statistics
+# User Guide
+This is a brief introduction on how to use "Toki Toki Task Bot".
+
+
+## What is Duke?
+Duke is a task bot built to keep track of all your task and schedules.
+Users can add and delete their tasks and Duke will keep track of all your task for you.
+
+## Who is Yuri?
+
+
+
+Yuri is personality built on top of Duke, the original bot. Yuri aims to ensure that you as a user understand her pain of keeping track of all your task.
+Even though she is supposed to track the task for you, she will not hesitate to express her displeasure at your laziness and irresponsibility in handling your own to do list.
+
+## Installing the Doki Doki Task Bot
+Navigate to [github Releases](https://github.com/Deunitato/duke/releases) and download the latest release. Place the jar file into a new folder.
+Opening the Jar file will show a welcome text from YURI.
+
+
+
+## Features
+
+#### Create your own tasks
+ 1. Create todo tasks
+ 2. Create event tasks
+ 3. Create deadline tasks
+#### Organising your task
+ 1. Listing
+ 2. Mark your tasks as done
+ 3. Find tasks
+ 4. Delete tasks
+
+#### List your own tasks
+Ask Yuri to display the task that you have to do
+
+#### Check your statistics
+Yuri will also keep track of things that you did within the day and week.
+
+ 1. Check the tasks done today/this week
+ 2. Check number of types done
+ 3. Check the task that expired
+
+#### Tsundere Personality
+Yuri will "hate" your laziness but still feel compelled to serve you as your personal secretary.
+
+
+## Usage
+
+Basic commands that Yuri will respond to.
+
+### Creating your own tasks
+
+#### `TODO` - Creates an todo task
+
+Adds a TODO Tasks into your list
+
+Example of usage:
+
+`Todo Read Book`
+
+Expected outcome:
+
+`sighssss...am I your slave again?`
+
+#### `Event` - Creates an event task
+
+Creates a event and adds it into your list
+Yuri also requires the date of the event as denoted by /at
+
+Example of usage:
+
+`event Anime Matsuri /at 12/01/2020`
+
+`event Anime Matsuri /at 12/01/2020 1200`
+
+`event Anime Matsuri /at 1200`
+
+Expected outcome:
+
+`sighsssss...am I your slave again?`
+
+#### `Deadline` - Creates an deadline
+
+Creates a deadline and adds it into your list
+Yuri also requires the date of the event as denoted by /by
+
+Example of usage:
+
+`event Homework /at 12/01/2020`
+
+`event Homework /at 1200`
+
+`event Homework /at 12/01/2020 1200`
+
+Expected outcome:
+
+`sighsssss...am I your slave again?`
+
+### Organising your tasks
+
+#### `list` - Shows your list bucket
+
+Displays the list of task that you current have.
+
+Example of usage:
+
+`list`
+
+
+#### `Done` - Marks task as done
+
+Marks the task signified by ID as done
+
+Example of usage:
+
+`done 1`
+
+Expected outcome:
+
+`Okay whatever.. so you have completed this item.. so what? Marking item 1 as done `
+
+
+#### `Find` - Searches for a task
+
+Searches for tasks in your list
+
+Example of usage:
+
+`find home`
+
+Expected outcome:
+
+`Found this task in total:`
+
+` 1. [T][✘] Homework`
+
+`Found in total 1 tasks`
+
+#### `Delete` - Deletes your task
+
+Totally remove all records of your tasks
+
+Example of usage:
+
+`delete 1`
+
+Expected outcome:
+
+`Erasing your tracks are you?`
+
+### Checking your statistics
+
+### `Stats` - List out all the stats command
+
+Shows the list of stats command you could use.
+Examples of commands are
+ 1. `Expired` - list all the expired tasks
+ 2. `Week` - List the tasks you have completed in the week
+
+Example of usage:
+
+`stats`
+
+# Sample Screenshots of Yuri
+
+## Adding Tasks
+
+
+
+## Finding of Tasks
+
+
+## Statistics

\ No newline at end of file
diff --git a/docs/UI.PNG b/docs/UI.PNG
new file mode 100644
index 0000000000..1287819984
Binary files /dev/null and b/docs/UI.PNG differ
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100644
index 0000000000..3397c9a492
--- /dev/null
+++ b/docs/_config.yml
@@ -0,0 +1 @@
+theme: jekyll-theme-architect
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index f435030124..8c9551b003 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sat Feb 08 01:18:28 SGT 2020
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStorePath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
+#Sat Feb 08 01:18:28 SGT 2020
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
index af6708ff22..891a19fe74 100755
--- a/gradlew
+++ b/gradlew
@@ -1,172 +1,172 @@
-#!/usr/bin/env sh
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m"'
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn () {
- echo "$*"
-}
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=$(save "$@")
-
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
- cd "$(dirname "$0")"
-fi
-
-exec "$JAVACMD" "$@"
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 6d57edc706..0f8d5937c4 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,84 +1,84 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/memory.txt b/memory.txt
index 1fe0030a3d..3ddbcced2f 100644
--- a/memory.txt
+++ b/memory.txt
@@ -1,6 +1,6 @@
-deadline~true~oooo /by 10/02/2020 1200~11/2/2020
-todo~false~apple~1/1/1
-deadline~true~d1 /by 12/01/2020~12/2/2020
-todo~true~one more~12/2/2020
-todo~false~eeee~1/1/1
-todo~false~mytask~1/1/1
+deadline~true~oooo /by 10/02/2020 1200~11/2/2020
+todo~false~apple~1/1/1
+deadline~true~d1 /by 12/01/2020~12/2/2020
+todo~true~one more~12/2/2020
+todo~false~to test delete button~1/1/1
+event~false~anime matsuri /at 12/01/2020~1/1/1
diff --git a/settings.gradle b/settings.gradle
index d1e92fe5db..36565b6e98 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-rootProject.name = 'duke'
+rootProject.name = 'duke'
diff --git a/src/main/java/commands/AddCommand.java b/src/main/java/commands/AddCommand.java
index 9470b6fbd0..f14d705c78 100644
--- a/src/main/java/commands/AddCommand.java
+++ b/src/main/java/commands/AddCommand.java
@@ -1,62 +1,62 @@
-package commands;
-
-import database.MyList;
-
-import duke.UI;
-
-import resources.Task;
-import resources.ToDos;
-import resources.Deadline;
-import resources.Event;
-
-import exceptions.DukeException;
-
-/**
- * Commands.AddCommand is a Commands.Command that handles the adding of items
- * into the list when user calls.
- */
-public class AddCommand extends UserCommand {
-
- private static String desc;
- private static String type;
- private Task t;
-
- /**
- * Instantiates a new Add command.
- */
- AddCommand() {
- super(2);
- }
-
- /**
- * Instantiates a new Add command.
- *
- * @param type the type
- * @param desc the desc
- */
- AddCommand(String type, String desc) {
- super(2);
- this.desc = desc;
- this.type = type;
- }
-
- @Override
- public String reply() {
- return UI.getReply("add");
- }
-
- @Override
- public void action() throws DukeException {
- if (type.equals("todo")) {
- t = new ToDos(desc);
- } else if (type.equals("event")) {
- t = new Event(desc);
- } else {
- t = new Deadline(desc);
- }
-
- MyList.addItem(t);
- MyList.printCount();
- }
-
-}
+package commands;
+
+import database.MyList;
+
+import duke.UI;
+
+import resources.Task;
+import resources.ToDos;
+import resources.Deadline;
+import resources.Event;
+
+import exceptions.DukeException;
+
+/**
+ * Commands.AddCommand is a Commands.Command that handles the adding of items
+ * into the list when user calls.
+ */
+public class AddCommand extends UserCommand {
+
+ private static String desc;
+ private static String type;
+ private Task t;
+
+ /**
+ * Instantiates a new Add command.
+ */
+ AddCommand() {
+ super(2);
+ }
+
+ /**
+ * Instantiates a new Add command.
+ *
+ * @param type the type
+ * @param desc the desc
+ */
+ AddCommand(String type, String desc) {
+ super(2);
+ this.desc = desc;
+ this.type = type;
+ }
+
+ @Override
+ public String reply() {
+ return UI.getReply("add");
+ }
+
+ @Override
+ public void action() throws DukeException {
+ if (type.equals("todo")) {
+ t = new ToDos(desc);
+ } else if (type.equals("event")) {
+ t = new Event(desc);
+ } else {
+ t = new Deadline(desc);
+ }
+
+ MyList.addItem(t);
+ MyList.printCount();
+ }
+
+}
diff --git a/src/main/java/commands/ByeCommand.java b/src/main/java/commands/ByeCommand.java
index 6f49fec3ef..6ac8549baa 100644
--- a/src/main/java/commands/ByeCommand.java
+++ b/src/main/java/commands/ByeCommand.java
@@ -1,32 +1,32 @@
-package commands;
-
-import database.Storage;
-import duke.UI;
-import exceptions.DukeException;
-
-/**
- * The class Commands.ByeCommand exit the bot swiftly by
- * saving memory and stopping Invoker.
- */
-public class ByeCommand extends UserCommand {
-
- /**
- * Instantiates a new Bye command.
- */
- ByeCommand() {
- super(1);
- }
-
-
- @Override
- public String reply() {
- return (UI.getReply("bye"));
- }
-
- @Override
- public void action() throws DukeException {
- Storage.saveMemory();
- CommandInvoker.stop();
- }
-
-}
+package commands;
+
+import database.Storage;
+import duke.UI;
+import exceptions.DukeException;
+
+/**
+ * The class Commands.ByeCommand exit the bot swiftly by
+ * saving memory and stopping Invoker.
+ */
+public class ByeCommand extends UserCommand {
+
+ /**
+ * Instantiates a new Bye command.
+ */
+ ByeCommand() {
+ super(1);
+ }
+
+
+ @Override
+ public String reply() {
+ return (UI.getReply("bye"));
+ }
+
+ @Override
+ public void action() throws DukeException {
+ Storage.saveMemory();
+ CommandInvoker.stop();
+ }
+
+}
diff --git a/src/main/java/commands/Command.java b/src/main/java/commands/Command.java
index 0f6b3e7191..345cca5eed 100644
--- a/src/main/java/commands/Command.java
+++ b/src/main/java/commands/Command.java
@@ -1,31 +1,25 @@
-package commands;
-
-import exceptions.DukeException;
-
-/**
- * An interface skeleton for all UserCommands
- */
-public interface Command {
- /**
- * Replies User when command is executed
- *
- * @return String the response
- * @throws DukeException the duke exception
- */
- String reply() throws DukeException;
-
- /**
- * Executes the Action of the Commands.Command
- *
- * @return the boolean
- * @throws DukeException the duke exception
- */
- void action() throws DukeException;
-
- /**
- * Returns the ID of the command
- *
- * @return the id
- */
- public int getID();
-}
+package commands;
+
+import exceptions.DukeException;
+
+/**
+ * An interface skeleton for all UserCommands
+ */
+public interface Command {
+ /**
+ * Replies User when command is executed
+ *
+ * @return String the response
+ * @throws DukeException the duke exception
+ */
+ String reply() throws DukeException;
+
+ /**
+ * Executes the Action of the Commands.Command
+ *
+ * @return the boolean
+ * @throws DukeException the duke exception
+ */
+ void action() throws DukeException;
+
+}
diff --git a/src/main/java/commands/CommandHub.java b/src/main/java/commands/CommandHub.java
index eceb5ec1ab..193a8589e1 100644
--- a/src/main/java/commands/CommandHub.java
+++ b/src/main/java/commands/CommandHub.java
@@ -1,100 +1,100 @@
-package commands;
-
-import duke.UI;
-import exceptions.DukeException;
-import java.util.HashMap;
-
-/**
- * Commands.CommandHub class is for creation and initialisation of all commands.
- * Inclusive of setting up command specifics
- * ie. setting up task to be removed
- * "Parser"
- *
- */
- public class CommandHub {
- private static HashMap commandList = new HashMap();
-
- /**
- * Instantiates a new Commands.Command hub.
- */
- CommandHub() {
- };
-
- /**
- * Initialises the basic Commands.
- */
- public static void initCreator() {
- commandList.put("null", null);
- commandList.put("bye", new ByeCommand());
- commandList.put("list", new ListCommand());
- commandList.put("week", new ThisWeekCommand());
- commandList.put("today", new TodayCommand());
- commandList.put("deleted", new ShowDeletedCommand());
- commandList.put("expire", new ExpireCommand());
- commandList.put("stats", new StatsCommand());
- }
-
- /**
- * Parses the Commands.UserCommand
- *
- * @param userInput the user input
- * @return String Array parsedCommand
- */
- private static String[] parseString(String userInput) {
- userInput.toLowerCase();
- String[] parsedCommand = userInput.split(" ", 2);
- return parsedCommand;
- }
-
- /**
- * Fetch user command.
- *
- * @param userInput the user input
- * @return the user command
- * @throws DukeException the duke exception
- */
- public static UserCommand fetchCommand(String userInput) throws DukeException {
- String[] parsedCommand = parseString(userInput);
- String ID = parsedCommand[0];
- String desc = "null";
- if (parsedCommand.length > 1) { //check if exist second line
- desc = parsedCommand[1];
- }
-
- if (commandList.containsKey(ID)) { //gets generic commands
- return commandList.get(ID);
- }
-
- if (ID.contains("done")) { //done command
- if (desc.equals("null") || desc.equals("")) {
- throw new DukeException(UI.getReply("doneFieldEmpty"));
- }
- return new DoneCommand(Integer.parseInt(desc));
- }
-
- if (ID.contains("todo") || ID.contains("deadline") || ID.contains("event")) {
- if (desc.equals("null")) {
- throw new DukeException("BAKA! Your not suppose to leave "
- + ID + " field empty!");
- }
- return new AddCommand(ID, desc);
- }
-
- if (ID.contains("delete")) {
- if (desc.equals("null") || desc.equals("")) {
- throw new DukeException(UI.getReply("deleteFieldEmpty"));
- }
- return new DeleteCommand(Integer.parseInt(desc));
- }
-
- if (ID.contains("find")) {
- return new FindCommand(desc);
- }
-
- if (ID.contains("type")) {
- return new TypeCommand(desc);
- }
-
- throw new DukeException(UI.getReply("wrongCommand"));
- }
-}
+package commands;
+
+import duke.UI;
+import exceptions.DukeException;
+import java.util.HashMap;
+
+/**
+ * Commands.CommandHub class is for creation and initialisation of all commands.
+ * Inclusive of setting up command specifics
+ * ie. setting up task to be removed
+ * "Parser"
+ *
+ */
+ public class CommandHub {
+ private static HashMap commandList = new HashMap();
+
+ /**
+ * Instantiates a new Commands.Command hub.
+ */
+ CommandHub() {
+ };
+
+ /**
+ * Initialises the basic Commands.
+ */
+ public static void initCreator() {
+ commandList.put("null", null);
+ commandList.put("bye", new ByeCommand());
+ commandList.put("list", new ListCommand());
+ commandList.put("week", new ThisWeekCommand());
+ commandList.put("today", new TodayCommand());
+ commandList.put("deleted", new ShowDeletedCommand());
+ commandList.put("expire", new ExpireCommand());
+ commandList.put("stats", new StatsCommand());
+ }
+
+ /**
+ * Parses the Commands.UserCommand
+ *
+ * @param userInput the user input
+ * @return String Array parsedCommand
+ */
+ private static String[] parseString(String userInput) {
+ userInput.toLowerCase();
+ String[] parsedCommand = userInput.split(" ", 2);
+ return parsedCommand;
+ }
+
+ /**
+ * Fetch user command.
+ *
+ * @param userInput the user input
+ * @return the user command
+ * @throws DukeException the duke exception
+ */
+ public static UserCommand fetchCommand(String userInput) throws DukeException {
+ String[] parsedCommand = parseString(userInput);
+ String ID = parsedCommand[0];
+ String desc = "null";
+ if (parsedCommand.length > 1) { //check if exist second line
+ desc = parsedCommand[1];
+ }
+
+ if (commandList.containsKey(ID)) { //gets generic commands
+ return commandList.get(ID);
+ }
+
+ if (ID.contains("done")) { //done command
+ if (desc.equals("null") || desc.equals("")) {
+ throw new DukeException(UI.getReply("doneFieldEmpty"));
+ }
+ return new DoneCommand(Integer.parseInt(desc));
+ }
+
+ if (ID.contains("todo") || ID.contains("deadline") || ID.contains("event")) {
+ if (desc.equals("null")) {
+ throw new DukeException("BAKA! Your not suppose to leave "
+ + ID + " field empty!");
+ }
+ return new AddCommand(ID, desc);
+ }
+
+ if (ID.contains("delete")) {
+ if (desc.equals("null") || desc.equals("")) {
+ throw new DukeException(UI.getReply("deleteFieldEmpty"));
+ }
+ return new DeleteCommand(Integer.parseInt(desc));
+ }
+
+ if (ID.contains("find")) {
+ return new FindCommand(desc);
+ }
+
+ if (ID.contains("type")) {
+ return new TypeCommand(desc);
+ }
+
+ throw new DukeException(UI.getReply("wrongCommand"));
+ }
+}
diff --git a/src/main/java/commands/CommandInvoker.java b/src/main/java/commands/CommandInvoker.java
index 0714b1b9e5..de004495cb 100644
--- a/src/main/java/commands/CommandInvoker.java
+++ b/src/main/java/commands/CommandInvoker.java
@@ -1,47 +1,47 @@
-package commands; /*
-* "Duke.UI"
-* */
-
-import exceptions.DukeException;
-
-/**
- * The type Commands.Command invoker.
- */
-public class CommandInvoker {
-
- private static boolean isProgramEnd = false;
-
- /**
- * Instantiates a new Commands.Command invoker.
- */
- public CommandInvoker() {
- };
-
-
- /**
- * Invoke the Usercommand.
- *
- * @param c the Commands.UserCommand
- */
- public static String invoke(UserCommand c) throws DukeException {
- c.action();
- return c.reply();
- }
-
- /**
- * Stop the program. Sets the endProgram as true
- */
- public static void stop() {
- isProgramEnd = true;
- }
-
- /**
- * Checks if program is turning off
- *
- * @return the boolean
- */
- public static boolean isExit() {
- return isProgramEnd;
- }
-
-}
+package commands; /*
+* "Duke.UI"
+* */
+
+import exceptions.DukeException;
+
+/**
+ * The type Commands.Command invoker.
+ */
+public class CommandInvoker {
+
+ private static boolean isProgramEnd = false;
+
+ /**
+ * Instantiates a new Commands.Command invoker.
+ */
+ public CommandInvoker() {
+ };
+
+
+ /**
+ * Invoke the Usercommand.
+ *
+ * @param c the Commands.UserCommand
+ */
+ public static String invoke(UserCommand c) throws DukeException {
+ c.action();
+ return c.reply();
+ }
+
+ /**
+ * Stop the program. Sets the endProgram as true
+ */
+ public static void stop() {
+ isProgramEnd = true;
+ }
+
+ /**
+ * Checks if program is turning off
+ *
+ * @return the boolean
+ */
+ public static boolean isExit() {
+ return isProgramEnd;
+ }
+
+}
diff --git a/src/main/java/commands/DeleteCommand.java b/src/main/java/commands/DeleteCommand.java
index 785e1e460a..ea597e3f2d 100644
--- a/src/main/java/commands/DeleteCommand.java
+++ b/src/main/java/commands/DeleteCommand.java
@@ -1,45 +1,45 @@
-package commands;
-
-import database.MyList;
-import duke.UI;
-import exceptions.DukeException;
-
-/**
- * The class Commands.DeleteCommand handles the deletion of tasks
- */
-public class DeleteCommand extends UserCommand {
-
- private static int id;
-
- /**
- * Instantiates a new Delete command.
- *
- * @param id the id
- */
- DeleteCommand(int id) {
- super(5);
- setDel(id);
- }
-
- /**
- * Set the id of tasks
- *
- * @param ID the id
- */
- public static void setDel(int ID) {
- id = ID;
- }
-
- @Override
- public String reply() {
- return UI.getReply("delete");
- }
-
-
- @Override
- public void action() throws DukeException {
-
- MyList.deleteItem(id);
- MyList.printCount();
- }
-}
+package commands;
+
+import database.MyList;
+import duke.UI;
+import exceptions.DukeException;
+
+/**
+ * The class Commands.DeleteCommand handles the deletion of tasks
+ */
+public class DeleteCommand extends UserCommand {
+
+ private static int id;
+
+ /**
+ * Instantiates a new Delete command.
+ *
+ * @param id the id
+ */
+ DeleteCommand(int id) {
+ super(5);
+ setDel(id);
+ }
+
+ /**
+ * Set the id of tasks
+ *
+ * @param ID the id
+ */
+ public static void setDel(int ID) {
+ id = ID;
+ }
+
+ @Override
+ public String reply() {
+ return UI.getReply("delete");
+ }
+
+
+ @Override
+ public void action() throws DukeException {
+
+ MyList.deleteItem(id);
+ MyList.printCount();
+ }
+}
diff --git a/src/main/java/commands/DoneCommand.java b/src/main/java/commands/DoneCommand.java
index b817a25543..130c2bf611 100644
--- a/src/main/java/commands/DoneCommand.java
+++ b/src/main/java/commands/DoneCommand.java
@@ -1,44 +1,44 @@
-package commands;
-
-import database.MyList;
-import duke.UI;
-import exceptions.DukeException;
-
-/**
- * The class Commands.DoneCommand handles done
- * commands when user has completed the task
- */
-public class DoneCommand extends UserCommand {
- /**
- * The Id.
- */
- static int id = 0;
-
- /**
- * Instantiates a new Done command.
- *
- * @param id the id
- */
- DoneCommand(int id) {
- super(4);
- setDone(id);
- }
-
- /**
- * Set done.
- *
- * @param ID the id
- */
- public static void setDone(int ID) {
- id = ID;
- }
- @Override
- public String reply() {
- return UI.getReply("markedDone") + "\nMarking item " + id + " as done";
- }
-
- @Override
- public void action() throws DukeException {
- MyList.markDone(id);
- }
-}
+package commands;
+
+import database.MyList;
+import duke.UI;
+import exceptions.DukeException;
+
+/**
+ * The class Commands.DoneCommand handles done
+ * commands when user has completed the task
+ */
+public class DoneCommand extends UserCommand {
+ /**
+ * The Id.
+ */
+ static int id = 0;
+
+ /**
+ * Instantiates a new Done command.
+ *
+ * @param id the id
+ */
+ DoneCommand(int id) {
+ super(4);
+ setDone(id);
+ }
+
+ /**
+ * Set done.
+ *
+ * @param ID the id
+ */
+ public static void setDone(int ID) {
+ id = ID;
+ }
+ @Override
+ public String reply() {
+ return UI.getReply("markedDone") + "\nMarking item " + id + " as done";
+ }
+
+ @Override
+ public void action() throws DukeException {
+ MyList.markDone(id);
+ }
+}
diff --git a/src/main/java/commands/ExpireCommand.java b/src/main/java/commands/ExpireCommand.java
index 1abedb0f18..ecc2fafd00 100644
--- a/src/main/java/commands/ExpireCommand.java
+++ b/src/main/java/commands/ExpireCommand.java
@@ -1,20 +1,20 @@
-package commands;
-
-import resources.Statistics;
-
-public class ExpireCommand extends UserCommand {
-
- /**
- * Instantiates a new User command.
- * Set the ID
- *
- */
- ExpireCommand() {
- super(12);
- }
-
- @Override
- public String reply() {
- return Statistics.getExpired();
- }
-}
+package commands;
+
+import resources.Statistics;
+
+public class ExpireCommand extends UserCommand {
+
+ /**
+ * Instantiates a new User command.
+ * Set the ID
+ *
+ */
+ ExpireCommand() {
+ super(12);
+ }
+
+ @Override
+ public String reply() {
+ return Statistics.getExpired();
+ }
+}
diff --git a/src/main/java/commands/FindCommand.java b/src/main/java/commands/FindCommand.java
index 39fbb239a1..7f261e40bb 100644
--- a/src/main/java/commands/FindCommand.java
+++ b/src/main/java/commands/FindCommand.java
@@ -1,27 +1,27 @@
-package commands;
-
-import database.MyList;
-
-
-/**
- * FindCommand command handles when user wants to find something in list
- */
-public class FindCommand extends UserCommand {
- private static String keyword;
-
- /**
- * Instantiates a new User command.
- * Set the ID
- *
- * @param str the keyword
- */
- FindCommand(String str) {
- super(6);
- keyword = str;
- }
-
- @Override
- public String reply() {
- return MyList.find(keyword);
- }
-}
+package commands;
+
+import database.MyList;
+
+
+/**
+ * FindCommand command handles when user wants to find something in list
+ */
+public class FindCommand extends UserCommand {
+ private static String keyword;
+
+ /**
+ * Instantiates a new User command.
+ * Set the ID
+ *
+ * @param str the keyword
+ */
+ FindCommand(String str) {
+ super(6);
+ keyword = str;
+ }
+
+ @Override
+ public String reply() {
+ return MyList.find(keyword);
+ }
+}
diff --git a/src/main/java/commands/ListCommand.java b/src/main/java/commands/ListCommand.java
index e19a60e1a1..ab1b6dc82b 100644
--- a/src/main/java/commands/ListCommand.java
+++ b/src/main/java/commands/ListCommand.java
@@ -1,19 +1,19 @@
-package commands;
-
-import database.MyList;
-
-/**
- * The command handles when user calls list
- */
-public class ListCommand extends UserCommand {
- /**
- * Instantiates a new List command.
- */
- ListCommand() {
- super(3);
- }
- @Override
- public String reply() {
- return MyList.printList();
- }
-}
+package commands;
+
+import database.MyList;
+
+/**
+ * The command handles when user calls list
+ */
+public class ListCommand extends UserCommand {
+ /**
+ * Instantiates a new List command.
+ */
+ ListCommand() {
+ super(3);
+ }
+ @Override
+ public String reply() {
+ return MyList.printList();
+ }
+}
diff --git a/src/main/java/commands/LoadCommand.java b/src/main/java/commands/LoadCommand.java
index 31a0b6a27f..828fb68224 100644
--- a/src/main/java/commands/LoadCommand.java
+++ b/src/main/java/commands/LoadCommand.java
@@ -1,34 +1,34 @@
-package commands;
-
-import database.MyList;
-import exceptions.DukeException;
-
-/**
- * Loads the memory back into list
- */
-public class LoadCommand extends AddCommand {
-
- private static boolean isDone = false;
- private static int count = 0;
-
- /**
- * Instantiates a new Load command.
- *
- * @param type the type of task
- * @param setDone the set done status of tasks
- * @param desc the description of the task
- */
- public LoadCommand(String type, boolean setDone, String desc) {
- super(type, desc);
- this.isDone = setDone;
- }
-
- @Override
- public void action() throws DukeException {
- super.action();
- count++;
- if (isDone) {
- MyList.markDone(count);
- }
- }
-}
+package commands;
+
+import database.MyList;
+import exceptions.DukeException;
+
+/**
+ * Loads the memory back into list
+ */
+public class LoadCommand extends AddCommand {
+
+ private static boolean isDone = false;
+ private static int count = 0;
+
+ /**
+ * Instantiates a new Load command.
+ *
+ * @param type the type of task
+ * @param setDone the set done status of tasks
+ * @param desc the description of the task
+ */
+ public LoadCommand(String type, boolean setDone, String desc) {
+ super(type, desc);
+ this.isDone = setDone;
+ }
+
+ @Override
+ public void action() throws DukeException {
+ super.action();
+ count++;
+ if (isDone) {
+ MyList.markDone(count);
+ }
+ }
+}
diff --git a/src/main/java/commands/ShowDeletedCommand.java b/src/main/java/commands/ShowDeletedCommand.java
index c0e79b0932..0253256df2 100644
--- a/src/main/java/commands/ShowDeletedCommand.java
+++ b/src/main/java/commands/ShowDeletedCommand.java
@@ -1,21 +1,21 @@
-package commands;
-
-import resources.Statistics;
-
-public class ShowDeletedCommand extends UserCommand {
-
-
- /**
- * Instantiates a new User command.
- * Set the ID
- *
- */
- ShowDeletedCommand() {
- super(11);
- }
-
- @Override
- public String reply() {
- return Statistics.getNumDeleteTask();
- }
-}
+package commands;
+
+import resources.Statistics;
+
+public class ShowDeletedCommand extends UserCommand {
+
+
+ /**
+ * Instantiates a new User command.
+ * Set the ID
+ *
+ */
+ ShowDeletedCommand() {
+ super(11);
+ }
+
+ @Override
+ public String reply() {
+ return Statistics.getNumDeleteTask();
+ }
+}
diff --git a/src/main/java/commands/StatsCommand.java b/src/main/java/commands/StatsCommand.java
index e38033715c..6bb5046a43 100644
--- a/src/main/java/commands/StatsCommand.java
+++ b/src/main/java/commands/StatsCommand.java
@@ -1,20 +1,20 @@
-package commands;
-
-import duke.MainWindow;
-import duke.UI;
-
-public class StatsCommand extends UserCommand {
- /**
- * Instantiates a new User command.
- * Set the ID
- *
- */
- StatsCommand() {
- super(13);
- }
-
- @Override
- public String reply() {
- return UI.getInstrStats();
- }
-}
+package commands;
+
+import duke.MainWindow;
+import duke.UI;
+
+public class StatsCommand extends UserCommand {
+ /**
+ * Instantiates a new User command.
+ * Set the ID
+ *
+ */
+ StatsCommand() {
+ super(13);
+ }
+
+ @Override
+ public String reply() {
+ return UI.getInstrStats();
+ }
+}
diff --git a/src/main/java/commands/ThisWeekCommand.java b/src/main/java/commands/ThisWeekCommand.java
index cec2c749b9..d16a7da811 100644
--- a/src/main/java/commands/ThisWeekCommand.java
+++ b/src/main/java/commands/ThisWeekCommand.java
@@ -1,20 +1,20 @@
-package commands;
-
-import resources.Statistics;
-
-public class ThisWeekCommand extends UserCommand {
-
- /**
- * Instantiates a new User command.
- * Set the ID
- *
- */
- ThisWeekCommand() {
- super(7);
- }
-
- @Override
- public String reply() {
- return Statistics.taskDoneWeek();
- }
-}
+package commands;
+
+import resources.Statistics;
+
+public class ThisWeekCommand extends UserCommand {
+
+ /**
+ * Instantiates a new User command.
+ * Set the ID
+ *
+ */
+ ThisWeekCommand() {
+ super(7);
+ }
+
+ @Override
+ public String reply() {
+ return Statistics.taskDoneWeek();
+ }
+}
diff --git a/src/main/java/commands/TodayCommand.java b/src/main/java/commands/TodayCommand.java
index 6faf59b40f..5f8e73e8b4 100644
--- a/src/main/java/commands/TodayCommand.java
+++ b/src/main/java/commands/TodayCommand.java
@@ -1,19 +1,19 @@
-package commands;
-
-import resources.Statistics;
-
-public class TodayCommand extends UserCommand {
- /**
- * Instantiates a new User command.
- * Set the ID
- *
- */
- TodayCommand() {
- super(10);
- }
-
- @Override
- public String reply() {
- return Statistics.taskDone();
- }
-}
+package commands;
+
+import resources.Statistics;
+
+public class TodayCommand extends UserCommand {
+ /**
+ * Instantiates a new User command.
+ * Set the ID
+ *
+ */
+ TodayCommand() {
+ super(10);
+ }
+
+ @Override
+ public String reply() {
+ return Statistics.taskDone();
+ }
+}
diff --git a/src/main/java/commands/TypeCommand.java b/src/main/java/commands/TypeCommand.java
index 84553a1213..35b75c3ba3 100644
--- a/src/main/java/commands/TypeCommand.java
+++ b/src/main/java/commands/TypeCommand.java
@@ -1,28 +1,28 @@
-package commands;
-
-import duke.UI;
-import resources.Statistics;
-
-/**
- * This class is command to invoke part of the statistics class
- *
- * */
-public class TypeCommand extends UserCommand {
- private String type;
-
- /**
- * Instantiates a new User command.
- * Set the ID
- * @param type Takes in a String of Type
- */
- TypeCommand(String type) {
- super(9);
- this.type = type;
- }
-
- @Override
- public String reply() {
- return UI.getReply("gettingTypes\n") + Statistics.getTypes(type);
- }
-
-}
+package commands;
+
+import duke.UI;
+import resources.Statistics;
+
+/**
+ * This class is command to invoke part of the statistics class
+ *
+ * */
+public class TypeCommand extends UserCommand {
+ private String type;
+
+ /**
+ * Instantiates a new User command.
+ * Set the ID
+ * @param type Takes in a String of Type
+ */
+ TypeCommand(String type) {
+ super(9);
+ this.type = type;
+ }
+
+ @Override
+ public String reply() {
+ return UI.getReply("gettingTypes\n") + Statistics.getTypes(type);
+ }
+
+}
diff --git a/src/main/java/commands/UserCommand.java b/src/main/java/commands/UserCommand.java
index 175ef7d33d..517a44032d 100644
--- a/src/main/java/commands/UserCommand.java
+++ b/src/main/java/commands/UserCommand.java
@@ -1,36 +1,36 @@
-package commands;
-
-import exceptions.DukeException;
-
-/**
- * The class Commands.UserCommand acts as a parent class for commands
- */
-public class UserCommand implements Command {
- private int ID = 0;
-
- /**
- * Instantiates a new User command.
- * Set the ID
- *
- * @param id the id
- */
- UserCommand(int id) {
- ID = id;
- };
-
-
- @Override
- public String reply() {
- return "This is some crazy event";
- }
-
- @Override
- public void action() throws DukeException {
- }
-
-
- @Override
- public int getID() {
- return ID;
- }
-}
+package commands;
+
+import exceptions.DukeException;
+
+/**
+ * The class Commands.UserCommand acts as a parent class for commands
+ */
+public class UserCommand implements Command {
+ private int ID = 0;
+
+ /**
+ * Instantiates a new User command.
+ * Set the ID
+ *
+ * @param id the id
+ */
+ UserCommand(int id) {
+ ID = id;
+ };
+
+
+ @Override
+ public String reply() {
+ return "This is some crazy event";
+ }
+
+ @Override
+ public void action() throws DukeException {
+ }
+
+
+ @Override
+ public int getID() {
+ return ID;
+ }
+}
diff --git a/src/main/java/database/MyList.java b/src/main/java/database/MyList.java
index 6310af81ed..61c016c325 100644
--- a/src/main/java/database/MyList.java
+++ b/src/main/java/database/MyList.java
@@ -1,138 +1,138 @@
-package database;
-
-import duke.UI;
-import exceptions.DukeException;
-import resources.Task;
-import resources.TaskTracker;
-
-import java.util.ArrayList;
-
-/**
- * Database.MyList handles everything to do with the list
- */
-public class MyList {
- private static ArrayList listOfTasks = new ArrayList<>();
- private static Task justAdded;
-
- /**
- * Add tasks.
- *
- * @param t the t
- */
- public static void addItem(Task t) {
- System.out.println("added: " + t);
- listOfTasks.add(t);
- justAdded = t;
- }
- /**
- * Gets the tasks that was recently just added in
- *
- * @return Task that was recently added
- */
- protected static Task getRecentAddedTask() {
- return justAdded;
- }
-
- /**
- * Delete tasks.
- *
- * @param ID the id
- * @throws DukeException the duke exception
- */
- public static void deleteItem(int ID)throws DukeException {
- ID = ID - 1;
- if (ID >= listOfTasks.size() || ID < 0) {
- throw new DukeException(UI.getReply("deleteEmpty"));
- }
- System.out.println("Deleted: " + listOfTasks.get(ID));
- TaskTracker.markDeleted();
- listOfTasks.remove(ID);
- }
-
-
- /**
- * Prints list.
- * @return A string with list prints
- */
- public static String printList() {
- String printed = "";
- if (listOfTasks.size() == 0) {
- return UI.getReply("emptyList");
- }
- int count = 1;
- for (Task t : listOfTasks) {
- printed = printed + count + ". " + t + "\n";
- count++;
- }
- return printed;
- }
-
- /**
- * Prints number of items in tasks.
- */
- public static void printCount() {
- System.out.println("Now you have " + listOfTasks.size() + " things in your bloody list..");
- }
-
- /**
- * Mark list item as done.
- *
- * @param ID the id
- * @throws DukeException the duke exception
- */
- public static void markDone(int ID) throws DukeException {
- ID = ID - 1;
- if (ID >= listOfTasks.size() || ID < 0) {
- throw new DukeException(UI.getReply("imaginary"));
- }
- listOfTasks.get(ID).markDone();
- //System.out.println(DaList.get(ID));
- }
-
- /**
- * Gets list array list.
- *
- * @return the list of objects
- */
- public static ArrayList getList() {
- return listOfTasks;
- }
-
- /**
- * Find existing objects and prints
- *
- * @param keyword takes in keyword
- * @return String stating number of items find
- */
- public static String find(String keyword) {
- ArrayList localList = populateFindList(keyword);
- int count = 1;
- String founded = "";
-
- if (localList.size() != 0) {
- founded = "Found these tasks:\n";
- }
- for (Task t: localList) {
- System.out.println(count + ". " + t);
- founded = founded + count + ". " + t + "\n";
- count++;
- }
- return founded + "Found in total of " + localList.size() + " items";
- }
-
- /**
- * Look through the list of objects and populate local list
- *
- * @param str takes in keyword
- * @return an ArrayList containing find results
- */
- private static ArrayList populateFindList(String str) {
- ArrayList localList = new ArrayList<>();
- for (Task t: listOfTasks) {
- if (t.toString().contains(str)) {
- localList.add(t);
- }
- }
- return localList;
- }
-}
+package database;
+
+import duke.UI;
+import exceptions.DukeException;
+import resources.Task;
+import resources.TaskTracker;
+
+import java.util.ArrayList;
+
+/**
+ * Database.MyList handles everything to do with the list
+ */
+public class MyList {
+ private static ArrayList listOfTasks = new ArrayList<>();
+ private static Task justAdded;
+
+ /**
+ * Add tasks.
+ *
+ * @param t the t
+ */
+ public static void addItem(Task t) {
+ System.out.println("added: " + t);
+ listOfTasks.add(t);
+ justAdded = t;
+ }
+ /**
+ * Gets the tasks that was recently just added in
+ *
+ * @return Task that was recently added
+ */
+ protected static Task getRecentAddedTask() {
+ return justAdded;
+ }
+
+ /**
+ * Delete tasks.
+ *
+ * @param ID the id
+ * @throws DukeException the duke exception
+ */
+ public static void deleteItem(int ID)throws DukeException {
+ ID = ID - 1;
+ if (ID >= listOfTasks.size() || ID < 0) {
+ throw new DukeException(UI.getReply("deleteEmpty"));
+ }
+ System.out.println("Deleted: " + listOfTasks.get(ID));
+ TaskTracker.markDeleted();
+ listOfTasks.remove(ID);
+ }
+
+
+ /**
+ * Prints list.
+ * @return A string with list prints
+ */
+ public static String printList() {
+ String printed = "";
+ if (listOfTasks.size() == 0) {
+ return UI.getReply("emptyList");
+ }
+ int count = 1;
+ for (Task t : listOfTasks) {
+ printed = printed + count + ". " + t + "\n";
+ count++;
+ }
+ return printed;
+ }
+
+ /**
+ * Prints number of items in tasks.
+ */
+ public static void printCount() {
+ System.out.println("Now you have " + listOfTasks.size() + " things in your bloody list..");
+ }
+
+ /**
+ * Mark list item as done.
+ *
+ * @param ID the id
+ * @throws DukeException the duke exception
+ */
+ public static void markDone(int ID) throws DukeException {
+ ID = ID - 1;
+ if (ID >= listOfTasks.size() || ID < 0) {
+ throw new DukeException(UI.getReply("imaginary"));
+ }
+ listOfTasks.get(ID).markDone();
+ //System.out.println(DaList.get(ID));
+ }
+
+ /**
+ * Gets list array list.
+ *
+ * @return the list of objects
+ */
+ public static ArrayList getList() {
+ return listOfTasks;
+ }
+
+ /**
+ * Find existing objects and prints
+ *
+ * @param keyword takes in keyword
+ * @return String stating number of items find
+ */
+ public static String find(String keyword) {
+ ArrayList localList = populateFindList(keyword);
+ int count = 1;
+ String founded = "";
+
+ if (localList.size() != 0) {
+ founded = "Found these tasks:\n";
+ }
+ for (Task t: localList) {
+ System.out.println(count + ". " + t);
+ founded = founded + count + ". " + t + "\n";
+ count++;
+ }
+ return founded + "Found in total of " + localList.size() + " items";
+ }
+
+ /**
+ * Look through the list of objects and populate local list
+ *
+ * @param str takes in keyword
+ * @return an ArrayList containing find results
+ */
+ private static ArrayList populateFindList(String str) {
+ ArrayList localList = new ArrayList<>();
+ for (Task t: listOfTasks) {
+ if (t.toString().contains(str)) {
+ localList.add(t);
+ }
+ }
+ return localList;
+ }
+}
diff --git a/src/main/java/database/Storage.java b/src/main/java/database/Storage.java
index 22e8f7ed0c..2ac888c9e2 100644
--- a/src/main/java/database/Storage.java
+++ b/src/main/java/database/Storage.java
@@ -1,172 +1,172 @@
-package database;
-import commands.CommandInvoker;
-import commands.LoadCommand;
-import duke.UI;
-import exceptions.DukeException;
-import resources.DateTimeHandler;
-import resources.Task;
-import database.MyList;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.FileReader;
-import java.io.BufferedReader;
-
-import java.time.LocalDate;
-import java.util.ArrayList;
-/**
- * * The class Database.Storage handles the memory segment of the Bot
- */
-public class Storage {
- private static File file;
-
- /**
- * Initialises memory
- */
- public static void memoryInit() {
- try {
- file = new File("memory.txt");
- if (file.createNewFile()) {
- System.out.println("Init new memory");
- } else {
- System.out.println("\nPrevious data found,"
- + " Loading memory...\n");
- loadMemory();
- }
- } catch (IOException e) {
- System.out.println("Failed to init memory..");
- }
- }
-
- private static void overwrite(String line) {
- try {
- BufferedWriter bw = new BufferedWriter(new FileWriter(file, false));
- bw.write(line);
- bw.newLine();
- bw.flush();
- bw.close();
- } catch (IOException e) {
- System.out.println(e.getMessage());
- }
- }
- private static void append(String line) {
- try {
- BufferedWriter bw = new BufferedWriter(new FileWriter(file,true));
- bw.write(line);
- bw.newLine();
- bw.flush();
- bw.close();
- } catch (IOException e) {
- System.out.println(e.getMessage());
- }
- }
-
- /**
- * Saves the memory on close.
- *
- * @throws DukeException the duke exception
- */
- public static void saveMemory() throws DukeException {
- ArrayList mylist = MyList.getList();
- boolean first = true;
-
- if (mylist.size() == 0) {
- overwrite("Wow..much emptiness");
- }
- for (Task t: mylist) {
- String[] splitted = t.toString().split(" ", 3);
- String type = parseType(splitted[0]);
- String isDone = parseDone(splitted[1]);
- String desc = parseDesc(splitted[2]);
- String doneDate = "1/1/1";
- if (isDone.equals("true")) {
- doneDate = parseDate(t.getDoneDate());
- }
-
- String buildLine = type + "~" + isDone + "~" + desc + "~" + doneDate;
- if (first) {
- first = false;
- overwrite(buildLine);
- continue;
- }
- append(buildLine);
- }
- }
-
-
- private static String parseDate(LocalDate d) {
- String date = "";
- int year = d.getYear();
- int month = d.getMonthValue();
- int day = d.getDayOfMonth();
- date = day + "/" + month + "/" + year;
- return date;
- }
- private static String parseType(String s) throws DukeException {
- if (s.equals("[D]")) {
- return "deadline";
- } else if (s.equals("[E]")) {
- return "event";
- } else if (s.equals("[T]")) {
- return "todo";
- } else {
- throw new DukeException(UI.getReply("memParsedError"));
- }
- }
- private static String parseDone(String s) {
- if (s.equals("[\u2713]")) {
- return "true";
- } else {
- return "false";
- }
- }
-
- private static String parseDesc(String str) {
- if (!str.contains("(")) {
- return str;
- }
- String typeSpecific = str.substring(str.indexOf("(") + 1, str.indexOf(":"));
- String desc = str.substring(0, str.indexOf("(") - 1);
- String datedesc = str.substring(str.indexOf(":") + 2, str.indexOf(")"));
- return desc + "/" + typeSpecific + " " + DateTimeHandler.revertDateTime(datedesc);
-
- }
-
- private static void loadMemory() {
- try (BufferedReader br = new BufferedReader(new FileReader(file))) {
- String line;
- while ((line = br.readLine()) != null) {
- if (line.equals("Wow..much emptiness")) {
- return;
- }
- boolean markdone;
- String[] splitted = line.split("~");
- if (splitted[1].equals("false")) {
- markdone = false;
- } else {
- markdone = true;
- }
- CommandInvoker.invoke(new LoadCommand(splitted[0], markdone, splitted[2]));
-
- if (splitted[1].equals("true")) {
- Task t = MyList.getRecentAddedTask();
- String[] dates = splitted[3].split("/");
- int year = Integer.parseInt(dates[2]);
- int month = Integer.parseInt(dates[1]);
- int day = Integer.parseInt(dates[0]);
-
- LocalDate d = LocalDate.of(year, month, day);
- t.setDone(d);
- }
-
- }
- } catch (IOException e) {
- e.printStackTrace();
- } catch (DukeException e) {
- e.printStackTrace();
- }
-
- }
-}
+package database;
+import commands.CommandInvoker;
+import commands.LoadCommand;
+import duke.UI;
+import exceptions.DukeException;
+import resources.DateTimeHandler;
+import resources.Task;
+import database.MyList;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.FileReader;
+import java.io.BufferedReader;
+
+import java.time.LocalDate;
+import java.util.ArrayList;
+/**
+ * * The class Database.Storage handles the memory segment of the Bot
+ */
+public class Storage {
+ private static File file;
+
+ /**
+ * Initialises memory
+ */
+ public static void memoryInit() {
+ try {
+ file = new File("DataFile.txt");
+ if (file.createNewFile()) {
+ System.out.println("Init new memory");
+ } else {
+ System.out.println("\nPrevious data found,"
+ + " Loading memory...\n");
+ loadMemory();
+ }
+ } catch (IOException e) {
+ System.out.println("Failed to init memory..");
+ }
+ }
+
+ private static void overwrite(String line) {
+ try {
+ BufferedWriter bw = new BufferedWriter(new FileWriter(file, false));
+ bw.write(line);
+ bw.newLine();
+ bw.flush();
+ bw.close();
+ } catch (IOException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+ private static void append(String line) {
+ try {
+ BufferedWriter bw = new BufferedWriter(new FileWriter(file,true));
+ bw.write(line);
+ bw.newLine();
+ bw.flush();
+ bw.close();
+ } catch (IOException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+
+ /**
+ * Saves the memory on close.
+ *
+ * @throws DukeException the duke exception
+ */
+ public static void saveMemory() throws DukeException {
+ ArrayList mylist = MyList.getList();
+ boolean first = true;
+
+ if (mylist.size() == 0) {
+ overwrite("Wow..much emptiness");
+ }
+ for (Task t: mylist) {
+ String[] splitted = t.toString().split(" ", 3);
+ String type = parseType(splitted[0]);
+ String isDone = parseDone(splitted[1]);
+ String desc = parseDesc(splitted[2]);
+ String doneDate = "1/1/1";
+ if (isDone.equals("true")) {
+ doneDate = parseDate(t.getDoneDate());
+ }
+
+ String buildLine = type + "~" + isDone + "~" + desc + "~" + doneDate;
+ if (first) {
+ first = false;
+ overwrite(buildLine);
+ continue;
+ }
+ append(buildLine);
+ }
+ }
+
+
+ private static String parseDate(LocalDate d) {
+ String date = "";
+ int year = d.getYear();
+ int month = d.getMonthValue();
+ int day = d.getDayOfMonth();
+ date = day + "/" + month + "/" + year;
+ return date;
+ }
+ private static String parseType(String s) throws DukeException {
+ if (s.equals("[D]")) {
+ return "deadline";
+ } else if (s.equals("[E]")) {
+ return "event";
+ } else if (s.equals("[T]")) {
+ return "todo";
+ } else {
+ throw new DukeException(UI.getReply("memParsedError"));
+ }
+ }
+ private static String parseDone(String s) {
+ if (s.equals("[\u2713]")) {
+ return "true";
+ } else {
+ return "false";
+ }
+ }
+
+ private static String parseDesc(String str) {
+ if (!str.contains("(")) {
+ return str;
+ }
+ String typeSpecific = str.substring(str.indexOf("(") + 1, str.indexOf(":"));
+ String desc = str.substring(0, str.indexOf("(") - 1);
+ String datedesc = str.substring(str.indexOf(":") + 2, str.indexOf(")"));
+ return desc + "/" + typeSpecific + " " + DateTimeHandler.revertDateTime(datedesc);
+
+ }
+
+ private static void loadMemory() {
+ try (BufferedReader br = new BufferedReader(new FileReader(file))) {
+ String line;
+ while ((line = br.readLine()) != null) {
+ if (line.equals("Wow..much emptiness")) {
+ return;
+ }
+ boolean markdone;
+ String[] splitted = line.split("~");
+ if (splitted[1].equals("false")) {
+ markdone = false;
+ } else {
+ markdone = true;
+ }
+ CommandInvoker.invoke(new LoadCommand(splitted[0], markdone, splitted[2]));
+
+ if (splitted[1].equals("true")) {
+ Task t = MyList.getRecentAddedTask();
+ String[] dates = splitted[3].split("/");
+ int year = Integer.parseInt(dates[2]);
+ int month = Integer.parseInt(dates[1]);
+ int day = Integer.parseInt(dates[0]);
+
+ LocalDate d = LocalDate.of(year, month, day);
+ t.setDone(d);
+ }
+
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (DukeException e) {
+ e.printStackTrace();
+ }
+
+ }
+}
diff --git a/src/main/java/duke/DialogBox.java b/src/main/java/duke/DialogBox.java
index e7a0c064e5..c6c2849429 100644
--- a/src/main/java/duke/DialogBox.java
+++ b/src/main/java/duke/DialogBox.java
@@ -1,78 +1,78 @@
-package duke;
-
-import java.io.IOException;
-import java.util.Collections;
-
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.fxml.FXML;
-import javafx.fxml.FXMLLoader;
-import javafx.geometry.Pos;
-import javafx.scene.Node;
-import javafx.scene.control.Label;
-import javafx.scene.image.Image;
-import javafx.scene.image.ImageView;
-import javafx.scene.layout.HBox;
-
-/**
- * An example of a custom control using FXML.
- * This control represents a dialog box consisting of an ImageView to represent the speaker's face and a label
- * containing text from the speaker.
- */
-public class DialogBox extends HBox {
- @FXML
- private Label dialog;
- @FXML
- private ImageView displayPicture;
-
- private DialogBox(String text, Image img) {
- try {
- FXMLLoader fxmlLoader =
- new FXMLLoader(MainWindow.class.getResource("/view/DialogBox.fxml"));
- fxmlLoader.setController(this);
- fxmlLoader.setRoot(this);
- fxmlLoader.load();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- dialog.setText(text);
- displayPicture.setImage(img);
- dialog.setMinHeight(Label.USE_PREF_SIZE); //friend's friend suggestion (Gerhean's friend)
- }
-
- /**
- * Flips the dialog box such that the ImageView is on the left and text on the right.
- */
- private void flip() {
- ObservableList tmp =
- FXCollections.observableArrayList(this.getChildren());
- Collections.reverse(tmp);
- getChildren().setAll(tmp);
- setAlignment(Pos.TOP_LEFT);
- }
-
- /**
- * Returns the user Dialog to caller
- *
- * @param text the text
- * @param img the img
- * @return the user dialog
- */
- public static DialogBox getUserDialog(String text, Image img) {
- return new DialogBox(text, img);
- }
-
- /**
- * Returns the Duke Dialogs to caller
- *
- * @param text the text
- * @param img the img
- * @return the duke dialog
- */
- public static DialogBox getDukeDialog(String text, Image img) {
- var db = new DialogBox(text, img);
- db.flip();
- return db;
- }
-}
+package duke;
+
+import java.io.IOException;
+import java.util.Collections;
+
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.geometry.Pos;
+import javafx.scene.Node;
+import javafx.scene.control.Label;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+import javafx.scene.layout.HBox;
+
+/**
+ * An example of a custom control using FXML.
+ * This control represents a dialog box consisting of an ImageView to represent the speaker's face and a label
+ * containing text from the speaker.
+ */
+public class DialogBox extends HBox {
+ @FXML
+ private Label dialog;
+ @FXML
+ private ImageView displayPicture;
+
+ private DialogBox(String text, Image img) {
+ try {
+ FXMLLoader fxmlLoader =
+ new FXMLLoader(MainWindow.class.getResource("/view/DialogBox.fxml"));
+ fxmlLoader.setController(this);
+ fxmlLoader.setRoot(this);
+ fxmlLoader.load();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ dialog.setText(text);
+ displayPicture.setImage(img);
+ dialog.setMinHeight(Label.USE_PREF_SIZE); //friend's friend suggestion (Gerhean's friend)
+ }
+
+ /**
+ * Flips the dialog box such that the ImageView is on the left and text on the right.
+ */
+ private void flip() {
+ ObservableList tmp =
+ FXCollections.observableArrayList(this.getChildren());
+ Collections.reverse(tmp);
+ getChildren().setAll(tmp);
+ setAlignment(Pos.TOP_LEFT);
+ }
+
+ /**
+ * Returns the user Dialog to caller
+ *
+ * @param text the text
+ * @param img the img
+ * @return the user dialog
+ */
+ public static DialogBox getUserDialog(String text, Image img) {
+ return new DialogBox(text, img);
+ }
+
+ /**
+ * Returns the Duke Dialogs to caller
+ *
+ * @param text the text
+ * @param img the img
+ * @return the duke dialog
+ */
+ public static DialogBox getDukeDialog(String text, Image img) {
+ var db = new DialogBox(text, img);
+ db.flip();
+ return db;
+ }
+}
diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java
index 48519bd78f..c76312be08 100644
--- a/src/main/java/duke/Duke.java
+++ b/src/main/java/duke/Duke.java
@@ -1,82 +1,82 @@
-package duke;
-
-import commands.CommandHub;
-import commands.CommandInvoker;
-import commands.UserCommand;
-import exceptions.DukeException;
-
-import java.util.Scanner;
-
-/**
- * The type Duke.
- */
-public class Duke {
- private CommandInvoker invoker = new CommandInvoker();
-
- /**
- * Instantiates a new Duke.
- */
- public Duke() {
- DukeInit.initBot();
- }
-
- /**
- * The entry point of application for cli
- *
- * @param args the input arguments
- */
- public static void main(String[] args) {
- new Duke().run();
- }
-
- /**
- * Run.
- */
- public void run() {
-
- while (!CommandInvoker.isExit()) {
- String userInput = getUserInput();
- try {
- UserCommand c = CommandHub.fetchCommand(userInput);
- invoker.invoke(c);
- } catch (DukeException e) {
- System.out.println(e.getMessage());
- }
-
- }
- }
-
-
- private static String getUserInput() {
- Scanner sc = new Scanner(System.in);
- System.out.print(">");
- String input = sc.nextLine();
-
- return input;
- }
-
- /**
- * You should have your own function to generate a response to user input.
- * Replace this stub with your completed method.
- *
- * @param input the input
- * @return the response
- */
- public String getResponse(String input) {
- String response = "";
- try {
- UserCommand c = CommandHub.fetchCommand(input);
- response = invoker.invoke(c);
- if (CommandInvoker.isExit()) {
- System.exit(0);
- }
- } catch (DukeException e) {
- response = e.getMessage();
- }
-
-
- return response;
- }
-}
-
-
+package duke;
+
+import commands.CommandHub;
+import commands.CommandInvoker;
+import commands.UserCommand;
+import exceptions.DukeException;
+
+import java.util.Scanner;
+
+/**
+ * The type Duke.
+ */
+public class Duke {
+ private CommandInvoker invoker = new CommandInvoker();
+
+ /**
+ * Instantiates a new Duke.
+ */
+ public Duke() {
+ DukeInit.initBot();
+ }
+
+ /**
+ * The entry point of application for cli
+ *
+ * @param args the input arguments
+ */
+ public static void main(String[] args) {
+ new Duke().run();
+ }
+
+ /**
+ * Run.
+ */
+ public void run() {
+
+ while (!CommandInvoker.isExit()) {
+ String userInput = getUserInput();
+ try {
+ UserCommand c = CommandHub.fetchCommand(userInput);
+ invoker.invoke(c);
+ } catch (DukeException e) {
+ System.out.println(e.getMessage());
+ }
+
+ }
+ }
+
+
+ private static String getUserInput() {
+ Scanner sc = new Scanner(System.in);
+ System.out.print(">");
+ String input = sc.nextLine();
+
+ return input;
+ }
+
+ /**
+ * You should have your own function to generate a response to user input.
+ * Replace this stub with your completed method.
+ *
+ * @param input the input
+ * @return the response
+ */
+ public String getResponse(String input) {
+ String response = "";
+ try {
+ UserCommand c = CommandHub.fetchCommand(input);
+ response = invoker.invoke(c);
+ if (CommandInvoker.isExit()) {
+ System.exit(0);
+ }
+ } catch (DukeException e) {
+ response = e.getMessage();
+ }
+
+
+ return response;
+ }
+}
+
+
diff --git a/src/main/java/duke/DukeInit.java b/src/main/java/duke/DukeInit.java
index 7f0012610f..72a6c69cbf 100644
--- a/src/main/java/duke/DukeInit.java
+++ b/src/main/java/duke/DukeInit.java
@@ -1,71 +1,67 @@
-package duke;
-
-import commands.CommandHub;
-import database.Storage;
-
-/**
- * Initialises the bot and holds strings pertaining to bot initialisation
- */
-public class DukeInit {
- /*private static String logo = " ____ _ \n"
- + "| _ \\ _ _| | _____ \n"
- + "| | | | | | | |/ / _ \\\n"
- + "| |_| | |_| | < __/\n"
- + "|____/ \\__,_|_|\\_\\___|\n";*/
- //got it from some text generator
- private static String logo = "\n" +
- "__ __ _ _ ______ _____ \n" +
- "\\ \\ / /| | | || ___ \\|_ _|\n" +
- " \\ V / | | | || |_/ / | | \n" +
- " \\ / | | | || / | | \n" +
- " | | | |_| || |\\ \\ _| |_ \n" +
- " \\_/ \\___/ \\_| \\_| \\___/ \n" +
- " \n" +
- " ";
- /**
- * Initalises bot.
- */
- public static void initBot() {
-
- System.out.println("Hello from\n" + logo);
- System.out.println("I am a very angry bot and I hate you");
- CommandHub.initCreator(); //init commands
- Storage.memoryInit(); //init memory
- System.out.println("Now what you want?");
- }
-
- /**
- * Returns the init line (welcome)
- *
- * @return A string with the welcome speech
- */
- public static String getInitLine() {
- return "Hello.. I am \n" + logo + "\nI am a very angry bot and I hate you";
- }
-
- /**
- * Returns the Instructions
- *
- * @return the String instr
- */
- public static String getInstrAdd() {
- String inst = "Here are my list of Commands:\n" +
- "========Add Tasks=======\n" +
- "1. todo \n" +
- "2. event /at (date or Time)\n" +
- "3. deadline /by (date or Time)\n\n";
- return inst;
- }
-
- public static String getInstrOther() {
- String inst = "======= Other commands =======\n" +
- "1. Find \n" +
- "2. Delete \n" +
- "3. Done \n" +
- "4. List\n" +
- "5. stats";
- return inst;
- }
-
-
-}
+package duke;
+
+import commands.CommandHub;
+import database.Storage;
+
+/**
+ * Initialises the bot and holds strings pertaining to bot initialisation
+ */
+public class DukeInit {
+ /*private static String logo = " ____ _ \n"
+ + "| _ \\ _ _| | _____ \n"
+ + "| | | | | | | |/ / _ \\\n"
+ + "| |_| | |_| | < __/\n"
+ + "|____/ \\__,_|_|\\_\\___|\n";*/
+ //got it from some text generator
+ private static String logo = " _ _ _ _ ___ _ \n" +
+ " | | | | | | | . \\ | |\n" +
+ " \\ / | ' | | / | |\n" +
+ " |_| `___' |_\\_\\ |_|\n" +
+ " \n";
+ /**
+ * Initalises bot.
+ */
+ public static void initBot() {
+
+ System.out.println("Hello from\n" + logo);
+ System.out.println("I am a very angry bot and I hate you");
+ CommandHub.initCreator(); //init commands
+ Storage.memoryInit(); //init memory
+ System.out.println("Now what you want?");
+ }
+
+ /**
+ * Returns the init line (welcome)
+ *
+ * @return A string with the welcome speech
+ */
+ public static String getInitLine() {
+ return "Hello.. I am \n" + logo + "\nI am a very angry bot and I hate you";
+ }
+
+ /**
+ * Returns the Instructions
+ *
+ * @return the String instr
+ */
+ public static String getInstrAdd() {
+ String inst = "Here are my list of Commands:\n" +
+ "========Add Tasks=======\n" +
+ "1. todo \n" +
+ "2. event /at (date or Time)\n" +
+ "3. deadline /by (date or Time)\n\n";
+ return inst;
+ }
+
+ public static String getInstrOther() {
+ String inst = "======= Other commands =======\n" +
+ "1. Find \n" +
+ "2. Delete \n" +
+ "3. Done \n" +
+ "4. List\n" +
+ "5. stats";
+ return inst;
+ }
+
+
+}
diff --git a/src/main/java/duke/Launcher.java b/src/main/java/duke/Launcher.java
index e4ef6b4628..bda9e36579 100644
--- a/src/main/java/duke/Launcher.java
+++ b/src/main/java/duke/Launcher.java
@@ -1,12 +1,12 @@
-package duke;
-
-import javafx.application.Application;
-
-/**
- * A launcher class to workaround classpath issues.
- */
-public class Launcher {
- public static void main(String[] args) {
- Application.launch(Main.class, args);
- }
-}
+package duke;
+
+import javafx.application.Application;
+
+/**
+ * A launcher class to workaround classpath issues.
+ */
+public class Launcher {
+ public static void main(String[] args) {
+ Application.launch(Main.class, args);
+ }
+}
diff --git a/src/main/java/duke/Main.java b/src/main/java/duke/Main.java
index d980b24a1e..e42be4596f 100644
--- a/src/main/java/duke/Main.java
+++ b/src/main/java/duke/Main.java
@@ -1,41 +1,50 @@
-package duke;
-
-import java.io.IOException;
-
-import javafx.application.Application;
-import javafx.fxml.FXMLLoader;
-import javafx.scene.Scene;
-import javafx.scene.image.Image;
-import javafx.scene.layout.AnchorPane;
-import javafx.stage.Stage;
-
-/**
- * A GUI for Duke.Duke using FXML.
- */
-public class Main extends Application {
-
- private Duke duke = new Duke();
-
- @Override
- public void start(Stage stage) {
- try {
- FXMLLoader fxmlLoader =
- new FXMLLoader(Main.class.getResource("/view/MainWindow.fxml"));
-
- AnchorPane ap = fxmlLoader.load();
- Scene scene = new Scene(ap);
- stage.setScene(scene);
- stage.setTitle("Doki Doki Task Bot");
- stage.centerOnScreen();
- stage.setResizable(false);
- //Get icon code snippet from https://stackoverflow.com/questions/20094620/set-icon-on-stage-in-javafx/20094784
- stage.getIcons().add(new Image(("/images/mitsuri.jpg")));
-
- fxmlLoader.getController().setDuke(duke);
- stage.show();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
-}
+package duke;
+
+import java.io.IOException;
+
+import commands.CommandInvoker;
+import database.Storage;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.scene.layout.AnchorPane;
+import javafx.stage.Stage;
+
+/**
+ * A GUI for Duke.Duke using FXML.
+ */
+public class Main extends Application {
+
+ private Duke duke = new Duke();
+
+ @Override
+ public void start(Stage stage) {
+ try {
+ FXMLLoader fxmlLoader =
+ new FXMLLoader(Main.class.getResource("/view/MainWindow.fxml"));
+
+ AnchorPane ap = fxmlLoader.load();
+ Scene scene = new Scene(ap);
+ stage.setScene(scene);
+ stage.setTitle("Doki Doki Task Bot");
+ stage.centerOnScreen();
+ stage.setResizable(false);
+ //Get icon code snippet from https://stackoverflow.com/questions/20094620/set-icon-on-stage-in-javafx/20094784
+ stage.getIcons().add(new Image(("/images/mitsuri.jpg")));
+
+ fxmlLoader.getController().setDuke(duke);
+ stage.show();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void stop() throws Exception {
+ Storage.saveMemory();
+ CommandInvoker.stop();
+ super.stop();
+ }
+}
diff --git a/src/main/java/duke/MainWindow.java b/src/main/java/duke/MainWindow.java
index 3b79156fda..08ecac13b3 100644
--- a/src/main/java/duke/MainWindow.java
+++ b/src/main/java/duke/MainWindow.java
@@ -1,97 +1,97 @@
-package duke;
-
-import javafx.fxml.FXML;
-import javafx.scene.control.Button;
-import javafx.scene.control.ScrollPane;
-import javafx.scene.control.TextField;
-import javafx.scene.image.Image;
-import javafx.scene.layout.AnchorPane;
-import javafx.scene.layout.VBox;
-
-/**
- * Controller for MainWindow. Provides the layout for the other controls.
- */
-public class MainWindow extends AnchorPane {
- @FXML
- private ScrollPane scrollPane;
- @FXML
- private VBox dialogContainer;
- @FXML
- private TextField userInput;
- @FXML
- private Button sendButton;
-
- private Duke duke;
-
- private Image userImage = new Image(this.getClass().getResourceAsStream("/images/masochist.png"));
- private Image dukeImage = new Image(this.getClass().getResourceAsStream("/images/meanGirl.jpeg"));
-
- /**
- * Initialize.
- */
- @FXML
- public void initialize() {
- scrollPane.vvalueProperty().bind(dialogContainer.heightProperty());
- botInitSpeech();
- botInstAdd();
- botInstOther();
- }
-
- /**
- * Sets duke.
- *
- * @param d the d
- */
- public void setDuke(Duke d) {
- duke = d;
- }
-
- /**
- * Creates two dialog boxes, one echoing user input and the other containing Duke.Duke's reply and then appends them to
- * the dialog container. Clears the user input after processing.
- */
- @FXML
- private void handleUserInput() {
- String input = userInput.getText();
- String response = duke.getResponse(input);
- dialogContainer.getChildren().addAll(
- DialogBox.getUserDialog(input, userImage),
- DialogBox.getDukeDialog(response, dukeImage)
- );
- userInput.clear();
- }
-
- /**
- * Prints the init welcome speech
- */
- public void botInitSpeech() {
- String response = DukeInit.getInitLine();
- dialogContainer.getChildren().addAll(
- DialogBox.getDukeDialog(response, dukeImage)
- );
- userInput.clear();
- }
-
- /**
- * Prints the instructions add for bot
- */
- public void botInstAdd() {
- String response = DukeInit.getInstrAdd();
- dialogContainer.getChildren().addAll(
- DialogBox.getDukeDialog(response, dukeImage)
- );
- userInput.clear();
- }
-
- /**
- * Prints the instructions other for bot
- */
- public void botInstOther() {
- String response = DukeInit.getInstrOther();
- dialogContainer.getChildren().addAll(
- DialogBox.getDukeDialog(response, dukeImage)
- );
- userInput.clear();
- }
-
+package duke;
+
+import javafx.fxml.FXML;
+import javafx.scene.control.Button;
+import javafx.scene.control.ScrollPane;
+import javafx.scene.control.TextField;
+import javafx.scene.image.Image;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.VBox;
+
+/**
+ * Controller for MainWindow. Provides the layout for the other controls.
+ */
+public class MainWindow extends AnchorPane {
+ @FXML
+ private ScrollPane scrollPane;
+ @FXML
+ private VBox dialogContainer;
+ @FXML
+ private TextField userInput;
+ @FXML
+ private Button sendButton;
+
+ private Duke duke;
+
+ private Image userImage = new Image(this.getClass().getResourceAsStream("/images/masochist.png"));
+ private Image dukeImage = new Image(this.getClass().getResourceAsStream("/images/meanGirl.jpeg"));
+
+ /**
+ * Initialize.
+ */
+ @FXML
+ public void initialize() {
+ scrollPane.vvalueProperty().bind(dialogContainer.heightProperty());
+ botInitSpeech();
+ botInstAdd();
+ botInstOther();
+ }
+
+ /**
+ * Sets duke.
+ *
+ * @param d the d
+ */
+ public void setDuke(Duke d) {
+ duke = d;
+ }
+
+ /**
+ * Creates two dialog boxes, one echoing user input and the other containing Duke.Duke's reply and then appends them to
+ * the dialog container. Clears the user input after processing.
+ */
+ @FXML
+ private void handleUserInput() {
+ String input = userInput.getText();
+ String response = duke.getResponse(input);
+ dialogContainer.getChildren().addAll(
+ DialogBox.getUserDialog(input, userImage),
+ DialogBox.getDukeDialog(response, dukeImage)
+ );
+ userInput.clear();
+ }
+
+ /**
+ * Prints the init welcome speech
+ */
+ public void botInitSpeech() {
+ String response = DukeInit.getInitLine();
+ dialogContainer.getChildren().addAll(
+ DialogBox.getDukeDialog(response, dukeImage)
+ );
+ userInput.clear();
+ }
+
+ /**
+ * Prints the instructions add for bot
+ */
+ public void botInstAdd() {
+ String response = DukeInit.getInstrAdd();
+ dialogContainer.getChildren().addAll(
+ DialogBox.getDukeDialog(response, dukeImage)
+ );
+ userInput.clear();
+ }
+
+ /**
+ * Prints the instructions other for bot
+ */
+ public void botInstOther() {
+ String response = DukeInit.getInstrOther();
+ dialogContainer.getChildren().addAll(
+ DialogBox.getDukeDialog(response, dukeImage)
+ );
+ userInput.clear();
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/duke/UI.java b/src/main/java/duke/UI.java
index d1b9636470..308b01714a 100644
--- a/src/main/java/duke/UI.java
+++ b/src/main/java/duke/UI.java
@@ -1,82 +1,82 @@
-package duke;
-
-/**
- * Class Duke.UI handles all Duke.UI interaction with user
- * Includes normal replies and exception replies
- */
-public class UI {
-
- /**
- * Returns a reply string according to id
- *
- * @param id the str
- * @return the string
- */
- public static String getReply(String id) {
- switch (id) {
- case "delete":
- return "Erasing your tracks are you?";
- case "emptyList":
- return "Eto..(Twindle thumbs).. You have nothing inside your list";
- case "bye":
- return "Bye. Have a nice day lol you shit...";
- case "add":
- return "Sighhssss...I am your slave again?";
- case "markedDone":
- return "Okay whatever.. so you have completed this item.. so what?";
- case "gettingTypes":
- return "So? Nothing special to check baka..";
- default:
- return getErrorMsg(id);
- }
- }
-
- private static String getErrorMsg(String id) {
- switch (id) {
- case "imaginary":
- return "You want to finish something imaginary??? "
- + "Please.. are you stupid?";
- case "emptyList":
- return "Eto..(Twindle thumbs).. You have nothing inside your list";
- case "deleteEmpty":
- return "Lol.. how about you delete yourself first!";
- case "doneAlready":
- return "Its done already!";
- case "memParsedError":
- return "Invalid file parsed error! Please delete the memory file..";
- case "doneFieldEmpty":
- return "Done with what? Your life is it?";
- case "wrongCommand":
- return "Hello? You stupid? Wrong command lah please!";
- case "deleteFieldEmpty":
- return "Delete yourself!";
- case "wrongDate":
- return "Don't understand your time.. Something like dd/mm/yyyy!";
- case "wrongDateFormat":
- return "Invalid date/time format.. Please input it like dd/mm/yyyy baka";
- case "wrongType":
- return "There is no such type stupid!";
- default:
- return "What you want?";
- }
- }
-
- /**
- * Returns the init line (welcome)
- *
- * @return A string with the instructions for stats
- */
- public static String getInstrStats() {
- String inst = "======= Stats commands =======\n" +
- "1. Type \n" +
- " Shows the tass by \n" +
- "2. Expired\n" +
- " Shows the tasks which are expired\n" +
- "3. Week/Today\n" +
- " Shows the task done in this week/today" +
- "4. Deleted\n" +
- " Show deleted task in session";
- return inst;
- }
-
-}
+package duke;
+
+/**
+ * Class Duke.UI handles all Duke.UI interaction with user
+ * Includes normal replies and exception replies
+ */
+public class UI {
+
+ /**
+ * Returns a reply string according to id
+ *
+ * @param id the str
+ * @return the string
+ */
+ public static String getReply(String id) {
+ switch (id) {
+ case "delete":
+ return "Erasing your tracks are you?";
+ case "emptyList":
+ return "Eto..(Twindle thumbs).. You have nothing inside your list";
+ case "bye":
+ return "Bye. Have a nice day lol you shit...";
+ case "add":
+ return "Sighhssss...I am your slave again?";
+ case "markedDone":
+ return "Okay whatever.. so you have completed this item.. so what?";
+ case "gettingTypes":
+ return "So? Nothing special to check baka..";
+ default:
+ return getErrorMsg(id);
+ }
+ }
+
+ private static String getErrorMsg(String id) {
+ switch (id) {
+ case "imaginary":
+ return "You want to finish something imaginary??? "
+ + "Please.. are you stupid?";
+ case "emptyList":
+ return "Eto..(Twindle thumbs).. You have nothing inside your list";
+ case "deleteEmpty":
+ return "Lol.. how about you delete yourself first!";
+ case "doneAlready":
+ return "Its done already!";
+ case "memParsedError":
+ return "Invalid file parsed error! Please delete the memory file..";
+ case "doneFieldEmpty":
+ return "Done with what? Your life is it?";
+ case "wrongCommand":
+ return "Hello? You stupid? Wrong command lah please!";
+ case "deleteFieldEmpty":
+ return "Delete yourself!";
+ case "wrongDate":
+ return "Don't understand your time.. Something like dd/mm/yyyy!";
+ case "wrongDateFormat":
+ return "Invalid date/time format.. Please input it like dd/mm/yyyy baka";
+ case "wrongType":
+ return "There is no such type stupid!";
+ default:
+ return "What you want?";
+ }
+ }
+
+ /**
+ * Returns the init line (welcome)
+ *
+ * @return A string with the instructions for stats
+ */
+ public static String getInstrStats() {
+ String inst = "======= Stats commands =======\n" +
+ "1. Type \n" +
+ " Shows the tass by \n" +
+ "2. Expired\n" +
+ " Shows the tasks which are expired\n" +
+ "3. Week/Today\n" +
+ " Shows the task done in this week/today" +
+ "4. Deleted\n" +
+ " Show deleted task in session";
+ return inst;
+ }
+
+}
diff --git a/src/main/java/exceptions/DukeException.java b/src/main/java/exceptions/DukeException.java
index 253071362c..74ea7aacef 100644
--- a/src/main/java/exceptions/DukeException.java
+++ b/src/main/java/exceptions/DukeException.java
@@ -1,15 +1,15 @@
-package exceptions;
-
-/**
- * The type Duke.Duke exception.
- */
-public class DukeException extends Exception {
- /**
- * Instantiates a new Duke.Duke exception.
- *
- * @param message the message
- */
- public DukeException(String message) {
- super(message);
- }
-}
+package exceptions;
+
+/**
+ * The type Duke.Duke exception.
+ */
+public class DukeException extends Exception {
+ /**
+ * Instantiates a new Duke.Duke exception.
+ *
+ * @param message the message
+ */
+ public DukeException(String message) {
+ super(message);
+ }
+}
diff --git a/src/main/java/resources/DateTime.java b/src/main/java/resources/DateTime.java
index e3c940229d..e1313352b6 100644
--- a/src/main/java/resources/DateTime.java
+++ b/src/main/java/resources/DateTime.java
@@ -1,73 +1,73 @@
-package resources;
-/**
- * The class Resources.
- * DateTime creates LocalDateTime objects for functions
- */
-import java.time.LocalDateTime;
-
-public class DateTime {
-
- private static LocalDateTime date;
-
- /**
- * Prints the time now.
- */
- public static void printNow() {
- date = LocalDateTime.now();
- System.out.println("Today is " + date);
- }
-
- /**
- * Gets date time local date time.
- *
- * @param date the date
- * @param time the time
- * @return the local date time
- */
- public static LocalDateTime getDateTime(String date, String time) {
- String[] dataArr = date.split("/");
- int year = Integer.parseInt(dataArr[2]);
- int month = Integer.parseInt(dataArr[1]);
- int day = Integer.parseInt(dataArr[0]);
-
- int timeConverted = Integer.parseInt(time);
- int hour = timeConverted / 100;
- int mins = timeConverted % 100;
- return LocalDateTime.of(year, month, day, hour, mins);
- }
-
- /**
- * Gets date local date time.
- *
- * @param date the date
- * @return the local date time
- */
- public static LocalDateTime getDate(String date) {
- String[] dataArr = date.split("/");
- int year = Integer.parseInt(dataArr[2]);
- int month = Integer.parseInt(dataArr[1]);
- int day = Integer.parseInt(dataArr[0]);
-
- return LocalDateTime.of(year, month, day, 0, 0, 0, 0);
- }
-
- /**
- * Gets time local date time.
- *
- * @param time the time
- * @return the local date time
- */
- public static LocalDateTime getTime(String time) {
- String[] dataArr = time.split("/");
- int timeConverted = Integer.parseInt(time);
- int hour = timeConverted / 100;
- int mins = timeConverted % 100;
-
- int year = LocalDateTime.now().getYear();
- int month = LocalDateTime.now().getMonthValue();
- int day = LocalDateTime.now().getDayOfMonth();
-
- return LocalDateTime.of(year, month, day, hour, mins);
- }
-
-}
+package resources;
+/**
+ * The class Resources.
+ * DateTime creates LocalDateTime objects for functions
+ */
+import java.time.LocalDateTime;
+
+public class DateTime {
+
+ private static LocalDateTime date;
+
+ /**
+ * Prints the time now.
+ */
+ public static void printNow() {
+ date = LocalDateTime.now();
+ System.out.println("Today is " + date);
+ }
+
+ /**
+ * Gets date time local date time.
+ *
+ * @param date the date
+ * @param time the time
+ * @return the local date time
+ */
+ public static LocalDateTime getDateTime(String date, String time) {
+ String[] dataArr = date.split("/");
+ int year = Integer.parseInt(dataArr[2]);
+ int month = Integer.parseInt(dataArr[1]);
+ int day = Integer.parseInt(dataArr[0]);
+
+ int timeConverted = Integer.parseInt(time);
+ int hour = timeConverted / 100;
+ int mins = timeConverted % 100;
+ return LocalDateTime.of(year, month, day, hour, mins);
+ }
+
+ /**
+ * Gets date local date time.
+ *
+ * @param date the date
+ * @return the local date time
+ */
+ public static LocalDateTime getDate(String date) {
+ String[] dataArr = date.split("/");
+ int year = Integer.parseInt(dataArr[2]);
+ int month = Integer.parseInt(dataArr[1]);
+ int day = Integer.parseInt(dataArr[0]);
+
+ return LocalDateTime.of(year, month, day, 0, 0, 0, 0);
+ }
+
+ /**
+ * Gets time local date time.
+ *
+ * @param time the time
+ * @return the local date time
+ */
+ public static LocalDateTime getTime(String time) {
+ String[] dataArr = time.split("/");
+ int timeConverted = Integer.parseInt(time);
+ int hour = timeConverted / 100;
+ int mins = timeConverted % 100;
+
+ int year = LocalDateTime.now().getYear();
+ int month = LocalDateTime.now().getMonthValue();
+ int day = LocalDateTime.now().getDayOfMonth();
+
+ return LocalDateTime.of(year, month, day, hour, mins);
+ }
+
+}
diff --git a/src/main/java/resources/DateTimeHandler.java b/src/main/java/resources/DateTimeHandler.java
index 54f73a88d3..3cdabaf69c 100644
--- a/src/main/java/resources/DateTimeHandler.java
+++ b/src/main/java/resources/DateTimeHandler.java
@@ -1,136 +1,136 @@
-package resources;
-/**
- * DateTimeHandler acts as a wrapper class for functions
- * to getLocalDate time using only
- * descriptions
- * It also handles anything regarding datetime
- */
-
-import duke.UI;
-import exceptions.DukeException;
-
-import java.time.DateTimeException;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.regex.Pattern;
-
-public class DateTimeHandler {
- /**
- * Gets local date time.
- *
- * @param desc the desc
- * @return the local date time
- * @throws DukeException the duke exception
- */
- public static LocalDateTime getLocalDateTime(String desc) throws DukeException {
- try {
- if (containsTime(desc)) {
- String[] splitted = desc.split(" ");
- return DateTime.getDateTime(splitted[0], splitted[1]);
- } else if (isValidDate(desc)) {
- return DateTime.getDate(desc);
- } else if (isValidTime(desc)) {
- return DateTime.getTime(desc);
- } else {
- throw new DukeException(UI.getReply("wrongDate"));
- }
- } catch (DateTimeException e) {
- throw new DukeException(UI.getReply("wrongDateFormat"));
- }
- }
-
- /**
- * Prints local date time string.
- *
- * @param dateTime the date time
- * @return the string
- */
- public static String printsLocalDateTime(LocalDateTime dateTime) {
- if (dateTime == null) {
- return "";
- } else if (dateTime.getHour() == 0 && dateTime.getMinute() == 0 && dateTime.getNano() == 0) { //only date
- return printDate(dateTime);
- } else {
- return printDateAndTime(dateTime);
- }
- }
-
- /**
- * Checks if given string contains time format
- *
- * @param desc description
- * @return boolean value if description contains time syntax
- */
- private static boolean containsTime(String desc) {
- String pattern = "[0-9]{2}/[0-9]{2}/[0-9]{4} [0-9]{4}";
- String patternEng = "[0-9]{2} [a-zA-Z]{3} [0-9]{4} [0-9]{2}:[0-9]{2}[apmAPM]{2}";
- String patternEng2 = "[0-9]{1} [a-zA-Z]{3} [0-9]{4} [0-9]{2}:[0-9]{2}[apmAPM]{2}";
- return Pattern.matches(pattern, desc)
- || Pattern.matches(patternEng, desc)
- || Pattern.matches(patternEng2, desc); //i know this is bad
- }
-
- /**
- * Checks if given string is valid date
- *
- * @param date date in string
- * @return boolean value if string is a valid date
- */
- private static boolean isValidDate(String date) {
- String pattern = "[0-9]{2}/[0-9]{2}/[0-9]{4}";
- return Pattern.matches(pattern, date);
- }
-
-
- /**
- * Checks if given string is valid time
- *
- * @param time time in string
- * @return boolean value if string is a valid time
- */
- private static boolean isValidTime(String time) {
- String pattern = "[0-9]{4}";
- return Pattern.matches(pattern, time);
- }
-
- /**
- * Reformats the dateTime
- *
- * @param dateTime
- * @return String of the dateTime in correct format
- */
- private static String printDateAndTime(LocalDateTime dateTime) {
- DateTimeFormatter formatter =
- DateTimeFormatter.ofPattern("d MMM yyyy hh:mma");
- return dateTime.format(formatter);
- }
-
- private static String printDate(LocalDateTime dateTime) {
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d MMM yyyy");
- return dateTime.format(formatter);
- }
-
- private static String printTime(LocalDateTime dateTime) {
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("hh:mm a");
- return dateTime.format(formatter);
- }
-
- /**
- * Reverts date time string for easier parse to memory.
- *
- * @param dateTime the date time
- * @return the string for memory storage
- */
- public static String revertDateTime(String dateTime) {
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d MMM yyyy hh:mma");
- DateTimeFormatter formatterSave = DateTimeFormatter.ofPattern("dd/MM/yyyy hhmm");
- if (!containsTime(dateTime)) {
- formatter = DateTimeFormatter.ofPattern("d MMM yyyy");
- formatterSave = DateTimeFormatter.ofPattern("dd/MM/yyyy");
- return LocalDate.parse(dateTime, formatter).format(formatterSave);
- }
- return LocalDateTime.parse(dateTime, formatter).format(formatterSave);
- }
-
-}
+package resources;
+/**
+ * DateTimeHandler acts as a wrapper class for functions
+ * to getLocalDate time using only
+ * descriptions
+ * It also handles anything regarding datetime
+ */
+
+import duke.UI;
+import exceptions.DukeException;
+
+import java.time.DateTimeException;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.regex.Pattern;
+
+public class DateTimeHandler {
+ /**
+ * Gets local date time.
+ *
+ * @param desc the desc
+ * @return the local date time
+ * @throws DukeException the duke exception
+ */
+ public static LocalDateTime getLocalDateTime(String desc) throws DukeException {
+ try {
+ if (containsTime(desc)) {
+ String[] splitted = desc.split(" ");
+ return DateTime.getDateTime(splitted[0], splitted[1]);
+ } else if (isValidDate(desc)) {
+ return DateTime.getDate(desc);
+ } else if (isValidTime(desc)) {
+ return DateTime.getTime(desc);
+ } else {
+ throw new DukeException(UI.getReply("wrongDate"));
+ }
+ } catch (DateTimeException e) {
+ throw new DukeException(UI.getReply("wrongDateFormat"));
+ }
+ }
+
+ /**
+ * Prints local date time string.
+ *
+ * @param dateTime the date time
+ * @return the string
+ */
+ public static String printsLocalDateTime(LocalDateTime dateTime) {
+ if (dateTime == null) {
+ return "";
+ } else if (dateTime.getHour() == 0 && dateTime.getMinute() == 0 && dateTime.getNano() == 0) { //only date
+ return printDate(dateTime);
+ } else {
+ return printDateAndTime(dateTime);
+ }
+ }
+
+ /**
+ * Checks if given string contains time format
+ *
+ * @param desc description
+ * @return boolean value if description contains time syntax
+ */
+ private static boolean containsTime(String desc) {
+ String pattern = "[0-9]{2}/[0-9]{2}/[0-9]{4} [0-9]{4}";
+ String patternEng = "[0-9]{2} [a-zA-Z]{3} [0-9]{4} [0-9]{2}:[0-9]{2}[apmAPM]{2}";
+ String patternEng2 = "[0-9]{1} [a-zA-Z]{3} [0-9]{4} [0-9]{2}:[0-9]{2}[apmAPM]{2}";
+ return Pattern.matches(pattern, desc)
+ || Pattern.matches(patternEng, desc)
+ || Pattern.matches(patternEng2, desc); //i know this is bad
+ }
+
+ /**
+ * Checks if given string is valid date
+ *
+ * @param date date in string
+ * @return boolean value if string is a valid date
+ */
+ private static boolean isValidDate(String date) {
+ String pattern = "[0-9]{2}/[0-9]{2}/[0-9]{4}";
+ return Pattern.matches(pattern, date);
+ }
+
+
+ /**
+ * Checks if given string is valid time
+ *
+ * @param time time in string
+ * @return boolean value if string is a valid time
+ */
+ private static boolean isValidTime(String time) {
+ String pattern = "[0-9]{4}";
+ return Pattern.matches(pattern, time);
+ }
+
+ /**
+ * Reformats the dateTime
+ *
+ * @param dateTime
+ * @return String of the dateTime in correct format
+ */
+ private static String printDateAndTime(LocalDateTime dateTime) {
+ DateTimeFormatter formatter =
+ DateTimeFormatter.ofPattern("d MMM yyyy hh:mma");
+ return dateTime.format(formatter);
+ }
+
+ private static String printDate(LocalDateTime dateTime) {
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d MMM yyyy");
+ return dateTime.format(formatter);
+ }
+
+ private static String printTime(LocalDateTime dateTime) {
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("hh:mm a");
+ return dateTime.format(formatter);
+ }
+
+ /**
+ * Reverts date time string for easier parse to memory.
+ *
+ * @param dateTime the date time
+ * @return the string for memory storage
+ */
+ public static String revertDateTime(String dateTime) {
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d MMM yyyy hh:mma");
+ DateTimeFormatter formatterSave = DateTimeFormatter.ofPattern("dd/MM/yyyy hhmm");
+ if (!containsTime(dateTime)) {
+ formatter = DateTimeFormatter.ofPattern("d MMM yyyy");
+ formatterSave = DateTimeFormatter.ofPattern("dd/MM/yyyy");
+ return LocalDate.parse(dateTime, formatter).format(formatterSave);
+ }
+ return LocalDateTime.parse(dateTime, formatter).format(formatterSave);
+ }
+
+}
diff --git a/src/main/java/resources/Deadline.java b/src/main/java/resources/Deadline.java
index 8900bf41dc..af7a4ed2e5 100644
--- a/src/main/java/resources/Deadline.java
+++ b/src/main/java/resources/Deadline.java
@@ -1,45 +1,45 @@
-package resources;
-
-import exceptions.DukeException;
-
-import java.time.LocalDateTime;
-
-/**
- * Deadlines is a type of task that accepts /by statements only
- */
-public class Deadline extends Task {
-
- private LocalDateTime deadline;
-
- /**
- * Instantiates a new Resources.Deadline.
- *
- * @param description the description
- * @throws DukeException the duke exception
- */
- public Deadline(String description) throws DukeException {
- super("default");
-
- String[] parsed = getParse(description);
- deadline = DateTimeHandler.getLocalDateTime(parsed[1]);
- super.resetDesc(parsed[0]);
- }
-
- public LocalDateTime getDeadline() {
- return deadline;
- }
-
- private String[] getParse(String desc) throws DukeException {
- if (!desc.contains("/by ")) {
- throw new DukeException("Hello? Missing your /by command!");
- }
- String[] parsed = desc.split("/by ");
- return parsed;
- }
- @Override
- public String toString() {
- return "[D] " + super.toString()
- + " (by: " + DateTimeHandler.printsLocalDateTime(deadline)
- + ")";
- }
-}
+package resources;
+
+import exceptions.DukeException;
+
+import java.time.LocalDateTime;
+
+/**
+ * Deadlines is a type of task that accepts /by statements only
+ */
+public class Deadline extends Task {
+
+ private LocalDateTime deadline;
+
+ /**
+ * Instantiates a new Resources.Deadline.
+ *
+ * @param description the description
+ * @throws DukeException the duke exception
+ */
+ public Deadline(String description) throws DukeException {
+ super("default");
+
+ String[] parsed = getParse(description);
+ deadline = DateTimeHandler.getLocalDateTime(parsed[1]);
+ super.resetDesc(parsed[0]);
+ }
+
+ public LocalDateTime getDeadline() {
+ return deadline;
+ }
+
+ private String[] getParse(String desc) throws DukeException {
+ if (!desc.contains("/by ")) {
+ throw new DukeException("Hello? Missing your /by command!");
+ }
+ String[] parsed = desc.split("/by ");
+ return parsed;
+ }
+ @Override
+ public String toString() {
+ return "[D] " + super.toString()
+ + " (by: " + DateTimeHandler.printsLocalDateTime(deadline)
+ + ")";
+ }
+}
diff --git a/src/main/java/resources/Event.java b/src/main/java/resources/Event.java
index 553fe97d0c..01555e1b50 100644
--- a/src/main/java/resources/Event.java
+++ b/src/main/java/resources/Event.java
@@ -1,49 +1,49 @@
-package resources;
-
-import exceptions.DukeException;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-
-/**
- * Resources.Event is a type of task that accepts /at statements only
- */
-public class Event extends Task {
-
- private LocalDateTime endDate;
-
- /**
- * Instantiates a new Resources.Event.
- *
- * @param description the description
- * @throws DukeException the duke exception
- */
- public Event(String description)throws DukeException {
- super("default");
-
-
- String[] parsed = getParse(description);
- endDate = DateTimeHandler.getLocalDateTime(parsed[1]);
- super.resetDesc(parsed[0]);
- }
-
- public LocalDateTime getEndDate() {
- return this.endDate;
- }
-
- private String[] getParse(String desc) throws DukeException {
- if (!desc.contains("/at ")) {
- throw new DukeException("Hello? Missing your /at command!");
- }
- String[] parsed = desc.split("/at ");
- return parsed;
- }
-
- @Override
- public String toString() {
- return "[E] " + super.toString()
- + " (at: " + DateTimeHandler.printsLocalDateTime(endDate) + ")";
- }
-
-
-}
+package resources;
+
+import exceptions.DukeException;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * Resources.Event is a type of task that accepts /at statements only
+ */
+public class Event extends Task {
+
+ private LocalDateTime endDate;
+
+ /**
+ * Instantiates a new Resources.Event.
+ *
+ * @param description the description
+ * @throws DukeException the duke exception
+ */
+ public Event(String description)throws DukeException {
+ super("default");
+
+
+ String[] parsed = getParse(description);
+ endDate = DateTimeHandler.getLocalDateTime(parsed[1]);
+ super.resetDesc(parsed[0]);
+ }
+
+ public LocalDateTime getEndDate() {
+ return this.endDate;
+ }
+
+ private String[] getParse(String desc) throws DukeException {
+ if (!desc.contains("/at ")) {
+ throw new DukeException("Hello? Missing your /at command!");
+ }
+ String[] parsed = desc.split("/at ");
+ return parsed;
+ }
+
+ @Override
+ public String toString() {
+ return "[E] " + super.toString()
+ + " (at: " + DateTimeHandler.printsLocalDateTime(endDate) + ")";
+ }
+
+
+}
diff --git a/src/main/java/resources/Statistics.java b/src/main/java/resources/Statistics.java
index 02b7a79fc3..b074bd16fe 100644
--- a/src/main/java/resources/Statistics.java
+++ b/src/main/java/resources/Statistics.java
@@ -1,77 +1,77 @@
-package resources;
-
-import duke.UI;
-
-/**
- * Handles everything to do with statistics
- */
-public class Statistics {
-
- /**
- * Adds a task that is finish into the list
- * Updates the current week
- *
- * @return String the task to add
- */
- public static String taskDoneWeek() {
- return TaskTracker.doneThisWeek();
- }
-
- /**
- * Adds a task that is finish into the list
- * Updates the current week
- *
- * @return String the task of things completed
- */
- public static String numDone() {
- return "You have completed" + TaskTracker.done() + " this week...";
- }
-
- /**
- * Returns the specific list for a specific
- * type of tasks
- * @return String the type searched
- */
- public static String getTypes(String type) {
- if (type.contains("event")) {
- return TaskTracker.getEventsString();
- }
-
- if (type.contains("todo") || type.contains("to do")) {
- return TaskTracker.getToDoString();
- }
-
- if (type.contains("deadline")) {
- return TaskTracker.getDeadlineString();
- }
-
- return UI.getReply("wrongType");
- }
-
- /**
- * Returns the tasks completed today
- * @return String the things done
- */
- public static String taskDone(){
- return TaskTracker.getDoneToday();
- }
-
- /**
- * Count of things deleted in session
- *
- * @return String of things deleted
- */
- public static String getNumDeleteTask(){
- return TaskTracker.showDeleted();
- }
-
- /**
- * Show the expired tasks
- *
- * @return String of things that are expired
- */
- public static String getExpired(){
- return TaskTracker.showExpired();
- }
-
-}
+package resources;
+
+import duke.UI;
+
+/**
+ * Handles everything to do with statistics
+ */
+public class Statistics {
+
+ /**
+ * Adds a task that is finish into the list
+ * Updates the current week
+ *
+ * @return String the task to add
+ */
+ public static String taskDoneWeek() {
+ return TaskTracker.doneThisWeek();
+ }
+
+ /**
+ * Adds a task that is finish into the list
+ * Updates the current week
+ *
+ * @return String the task of things completed
+ */
+ public static String numDone() {
+ return "You have completed" + TaskTracker.done() + " this week...";
+ }
+
+ /**
+ * Returns the specific list for a specific
+ * type of tasks
+ * @return String the type searched
+ */
+ public static String getTypes(String type) {
+ if (type.contains("event")) {
+ return TaskTracker.getEventsString();
+ }
+
+ if (type.contains("todo") || type.contains("to do")) {
+ return TaskTracker.getToDoString();
+ }
+
+ if (type.contains("deadline")) {
+ return TaskTracker.getDeadlineString();
+ }
+
+ return UI.getReply("wrongType");
+ }
+
+ /**
+ * Returns the tasks completed today
+ * @return String the things done
+ */
+ public static String taskDone(){
+ return TaskTracker.getDoneToday();
+ }
+
+ /**
+ * Count of things deleted in session
+ *
+ * @return String of things deleted
+ */
+ public static String getNumDeleteTask(){
+ return TaskTracker.showDeleted();
+ }
+
+ /**
+ * Show the expired tasks
+ *
+ * @return String of things that are expired
+ */
+ public static String getExpired(){
+ return TaskTracker.showExpired();
+ }
+
+}
diff --git a/src/main/java/resources/Task.java b/src/main/java/resources/Task.java
index 561b61078f..b05f36b381 100644
--- a/src/main/java/resources/Task.java
+++ b/src/main/java/resources/Task.java
@@ -1,80 +1,80 @@
-package resources;
-
-import duke.UI;
-import exceptions.DukeException;
-
-import java.time.LocalDate;
-
-/**
- * The type Resources.Task.
- */
-public class Task {
-
- private String Description = "";
- protected boolean isDone = false;
- private LocalDate doneDate;
-
- /**
- * Instantiates a new Resources.Task.
- *
- * @param description the description
- */
- public Task(String description) {
- this.Description = description;
- }
-
- /**
- * Reset desc.
- *
- * @param desc the desc
- */
- protected void resetDesc(String desc) {
- Description = desc;
- }
-
- /**
- * Mark done and set the date done time
- *
- * @throws DukeException the duke exception
- */
- public void markDone() throws DukeException {
- if (isDone) {
- throw new DukeException(UI.getReply("doneAlready"));
- }
- doneDate = LocalDate.now();
- TaskTracker.finishTask(this);
- isDone = true;
- }
-
- /**
- * Mark done and set the date done time
- *
- * @return LocalDate the Date this thing was done
- */
- public LocalDate getDoneDate() {
- return this.doneDate;
- }
-
- /**
- * Sets the done date of tasks
- * For Storage reloading function
- *
- * @param d LocalDate the Date this thing was done
- */
- public void setDone(LocalDate d) {
- this.doneDate = d;
- }
- /**
- * Gets status icon.
- *
- * @return the status icon
- */
- public String getStatusIcon() {
- return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols
- }
-
- @Override
- public String toString() {
- return "[" + getStatusIcon() + "] " + Description;
- }
-}
+package resources;
+
+import duke.UI;
+import exceptions.DukeException;
+
+import java.time.LocalDate;
+
+/**
+ * The type Resources.Task.
+ */
+public class Task {
+
+ private String Description = "";
+ protected boolean isDone = false;
+ private LocalDate doneDate;
+
+ /**
+ * Instantiates a new Resources.Task.
+ *
+ * @param description the description
+ */
+ public Task(String description) {
+ this.Description = description;
+ }
+
+ /**
+ * Reset desc.
+ *
+ * @param desc the desc
+ */
+ protected void resetDesc(String desc) {
+ Description = desc;
+ }
+
+ /**
+ * Mark done and set the date done time
+ *
+ * @throws DukeException the duke exception
+ */
+ public void markDone() throws DukeException {
+ if (isDone) {
+ throw new DukeException(UI.getReply("doneAlready"));
+ }
+ doneDate = LocalDate.now();
+ TaskTracker.finishTask(this);
+ isDone = true;
+ }
+
+ /**
+ * Mark done and set the date done time
+ *
+ * @return LocalDate the Date this thing was done
+ */
+ public LocalDate getDoneDate() {
+ return this.doneDate;
+ }
+
+ /**
+ * Sets the done date of tasks
+ * For Storage reloading function
+ *
+ * @param d LocalDate the Date this thing was done
+ */
+ public void setDone(LocalDate d) {
+ this.doneDate = d;
+ }
+ /**
+ * Gets status icon.
+ *
+ * @return the status icon
+ */
+ public String getStatusIcon() {
+ return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols
+ }
+
+ @Override
+ public String toString() {
+ return "[" + getStatusIcon() + "] " + Description;
+ }
+}
diff --git a/src/main/java/resources/TaskTracker.java b/src/main/java/resources/TaskTracker.java
index 6dc9a8b7a9..afc31f7870 100644
--- a/src/main/java/resources/TaskTracker.java
+++ b/src/main/java/resources/TaskTracker.java
@@ -1,232 +1,232 @@
-package resources;
-
-import database.MyList;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.temporal.TemporalField;
-import java.time.temporal.WeekFields;
-import java.util.ArrayList;
-import java.util.Locale;
-
-/**
- * Tracks the task's activity
- */
-public class TaskTracker {
-
- private static ArrayList listOfDoneTasks = new ArrayList<>();
- private static int currentWeek = 0;
- private static int deleted = 0;
-
- /**
- * Adds a task that is finish into the list
- * Updates the current week
- *
- * @param t the task to add
- */
- public static void finishTask(Task t) {
- listOfDoneTasks.add(t);
- }
-
- /**
- * Returns completed things this week
- *
- * @return String of things done this week
- */
- public static String doneThisWeek() {
- //update current week
- currentWeek = getWeek(LocalDate.now());
- ArrayList listOfDoneTasksWeek = updateDone();
- String ans = "";
- if (listOfDoneTasksWeek.size() != 0) {
- ans = "" + listToString(listOfDoneTasksWeek);
- }
- return ans + "You have completed "
- + listOfDoneTasksWeek.size() + " things this week\n";
- }
-
- /**
- * Returns number of items done this week
- *
- * @return int the task to add
- */
- public static int done() {
- return updateDone().size();
- }
-
- /**
- * Returns the list of Events in String
- *
- * @return String of Events
- */
- public static String getEventsString() {
- ArrayList current = MyList.getList();
- ArrayList events = new ArrayList<>();
- for (Task t : current) {
- if (t instanceof Event) {
- events.add(t);
- }
- }
- String ans = "";
- if (events.size()!= 0) {
- ans = listToString(events);
- }
- return ans + "You have "
- + events.size() + " events in your list\n";
- }
- /**
- * Returns the list of todos in String
- *
- * @return String of todos
- */
- public static String getToDoString() {
- ArrayList current = MyList.getList();
- ArrayList ToDo = new ArrayList<>();
- for (Task t : current) {
- if (t instanceof ToDos) {
- ToDo.add(t);
- }
- }
- String ans = "";
- if (ToDo.size()!= 0) {
- ans = listToString(ToDo);
- }
-
- return ans + "You have "
- + ToDo.size() + " todos in your list\n";
- }
-
- /**
- * Returns the list of Deadlines in String
- *
- * @return String of Deadlines
- */
- public static String getDeadlineString() {
- ArrayList current = MyList.getList();
- ArrayList deadlines = new ArrayList<>();
- for (Task t : current) {
- if (t instanceof Deadline) {
- deadlines.add(t);
- }
- }
- String ans = "";
- if (deadlines.size()!= 0) {
- ans = listToString(deadlines);
- }
-
- return ans + "You have "
- + deadlines.size() + " deadlines this week\n";
- }
-
- /**
- * Returns the String of things done today
- *
- * @return String of things completed today
- */
- public static String getDoneToday() {
- int todayDate = LocalDate.now().getDayOfMonth();
- int todayMonth = LocalDate.now().getMonthValue();
- ArrayList doneToday = new ArrayList<>();
- for (Task t : listOfDoneTasks) {
- int date = t.getDoneDate().getDayOfMonth();
- int month = t.getDoneDate().getMonthValue();
-
- if (date == todayDate && month == todayMonth) {
- doneToday.add(t);
- }
- }
- String ans = "";
- if (doneToday.size()!= 0) {
- ans = listToString(doneToday);
- }
-
- return ans + "You have completed "
- + doneToday.size() + " tasks today\n";
- }
-
- /**
- * Increments the number of things deleted in session
- *
- */
- public static void markDeleted() {
- deleted = deleted + 1;
- }
-
- public static String showExpired() {
- ArrayList current = MyList.getList();
- ArrayList expired = new ArrayList<>();
- for (Task t : current) {
- if (t.isDone) {
- continue;
- }
- if (t instanceof ToDos) {
- continue;
- }
- if (isExpired(t)) {
- expired.add(t);
- }
- }
-
- String ans = "";
- if (expired.size()!= 0) {
- ans = listToString(expired);
- }
-
- return ans + "You have "
- + expired.size() + " expired tasks\n";
- }
-
- /**
- * Returns the num of deleted items
- *
- * @return String of things deleted
- */
- public static String showDeleted() {
- return "You have deleted " + deleted + " task in this session.\n";
- }
-
- private static boolean isExpired(Task t) {
- LocalDate today = LocalDate.now();
- LocalDate checkDate = LocalDate.now();
- if (t instanceof Event) {
- checkDate = ((Event) t).getEndDate().toLocalDate();
- }
- if (t instanceof Deadline) {
- checkDate = ((Deadline) t).getDeadline().toLocalDate();
- }
-
- return checkDate.isBefore(today);
- }
-
- private static String listToString(ArrayList list) {
- String ans = "";
- int count = 1;
- for (Task t : list) {
- ans = ans + count + ". " + t + "\n";
- count++;
- }
- return ans;
- }
-
- private static ArrayList updateDone() {
- ArrayList newDoneTasks = new ArrayList<>();
- for (Task task: listOfDoneTasks) {
- if (isSameWeekAsToday(task.getDoneDate())) {
- newDoneTasks.add(task);
- }
- }
- return newDoneTasks;
- }
-
- private static boolean isSameWeekAsToday(LocalDate d) {
- int todayWeek = getWeek(d);
- return todayWeek == currentWeek;
- }
-
- //part of code snippet found at https://stackoverflow.com/questions/26012434/get-week-number-of-localdate-java-8/26013129
- private static int getWeek(LocalDate d) {
- TemporalField woy = WeekFields.of(Locale.getDefault()).weekOfWeekBasedYear();
- int todayWeekNum = d.get(woy);
- return todayWeekNum;
- }
-}
+package resources;
+
+import database.MyList;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.temporal.TemporalField;
+import java.time.temporal.WeekFields;
+import java.util.ArrayList;
+import java.util.Locale;
+
+/**
+ * Tracks the task's activity
+ */
+public class TaskTracker {
+
+ private static ArrayList listOfDoneTasks = new ArrayList<>();
+ private static int currentWeek = 0;
+ private static int deleted = 0;
+
+ /**
+ * Adds a task that is finish into the list
+ * Updates the current week
+ *
+ * @param t the task to add
+ */
+ public static void finishTask(Task t) {
+ listOfDoneTasks.add(t);
+ }
+
+ /**
+ * Returns completed things this week
+ *
+ * @return String of things done this week
+ */
+ public static String doneThisWeek() {
+ //update current week
+ currentWeek = getWeek(LocalDate.now());
+ ArrayList listOfDoneTasksWeek = updateDone();
+ String ans = "";
+ if (listOfDoneTasksWeek.size() != 0) {
+ ans = "" + listToString(listOfDoneTasksWeek);
+ }
+ return ans + "You have completed "
+ + listOfDoneTasksWeek.size() + " things this week\n";
+ }
+
+ /**
+ * Returns number of items done this week
+ *
+ * @return int the task to add
+ */
+ public static int done() {
+ return updateDone().size();
+ }
+
+ /**
+ * Returns the list of Events in String
+ *
+ * @return String of Events
+ */
+ public static String getEventsString() {
+ ArrayList current = MyList.getList();
+ ArrayList events = new ArrayList<>();
+ for (Task t : current) {
+ if (t instanceof Event) {
+ events.add(t);
+ }
+ }
+ String ans = "";
+ if (events.size()!= 0) {
+ ans = listToString(events);
+ }
+ return ans + "You have "
+ + events.size() + " events in your list\n";
+ }
+ /**
+ * Returns the list of todos in String
+ *
+ * @return String of todos
+ */
+ public static String getToDoString() {
+ ArrayList current = MyList.getList();
+ ArrayList ToDo = new ArrayList<>();
+ for (Task t : current) {
+ if (t instanceof ToDos) {
+ ToDo.add(t);
+ }
+ }
+ String ans = "";
+ if (ToDo.size()!= 0) {
+ ans = listToString(ToDo);
+ }
+
+ return ans + "You have "
+ + ToDo.size() + " todos in your list\n";
+ }
+
+ /**
+ * Returns the list of Deadlines in String
+ *
+ * @return String of Deadlines
+ */
+ public static String getDeadlineString() {
+ ArrayList current = MyList.getList();
+ ArrayList deadlines = new ArrayList<>();
+ for (Task t : current) {
+ if (t instanceof Deadline) {
+ deadlines.add(t);
+ }
+ }
+ String ans = "";
+ if (deadlines.size()!= 0) {
+ ans = listToString(deadlines);
+ }
+
+ return ans + "You have "
+ + deadlines.size() + " deadlines this week\n";
+ }
+
+ /**
+ * Returns the String of things done today
+ *
+ * @return String of things completed today
+ */
+ public static String getDoneToday() {
+ int todayDate = LocalDate.now().getDayOfMonth();
+ int todayMonth = LocalDate.now().getMonthValue();
+ ArrayList doneToday = new ArrayList<>();
+ for (Task t : listOfDoneTasks) {
+ int date = t.getDoneDate().getDayOfMonth();
+ int month = t.getDoneDate().getMonthValue();
+
+ if (date == todayDate && month == todayMonth) {
+ doneToday.add(t);
+ }
+ }
+ String ans = "";
+ if (doneToday.size()!= 0) {
+ ans = listToString(doneToday);
+ }
+
+ return ans + "You have completed "
+ + doneToday.size() + " tasks today\n";
+ }
+
+ /**
+ * Increments the number of things deleted in session
+ *
+ */
+ public static void markDeleted() {
+ deleted = deleted + 1;
+ }
+
+ public static String showExpired() {
+ ArrayList current = MyList.getList();
+ ArrayList expired = new ArrayList<>();
+ for (Task t : current) {
+ if (t.isDone) {
+ continue;
+ }
+ if (t instanceof ToDos) {
+ continue;
+ }
+ if (isExpired(t)) {
+ expired.add(t);
+ }
+ }
+
+ String ans = "";
+ if (expired.size()!= 0) {
+ ans = listToString(expired);
+ }
+
+ return ans + "You have "
+ + expired.size() + " expired tasks\n";
+ }
+
+ /**
+ * Returns the num of deleted items
+ *
+ * @return String of things deleted
+ */
+ public static String showDeleted() {
+ return "You have deleted " + deleted + " task in this session.\n";
+ }
+
+ private static boolean isExpired(Task t) {
+ LocalDate today = LocalDate.now();
+ LocalDate checkDate = LocalDate.now();
+ if (t instanceof Event) {
+ checkDate = ((Event) t).getEndDate().toLocalDate();
+ }
+ if (t instanceof Deadline) {
+ checkDate = ((Deadline) t).getDeadline().toLocalDate();
+ }
+
+ return checkDate.isBefore(today);
+ }
+
+ private static String listToString(ArrayList list) {
+ String ans = "";
+ int count = 1;
+ for (Task t : list) {
+ ans = ans + count + ". " + t + "\n";
+ count++;
+ }
+ return ans;
+ }
+
+ private static ArrayList updateDone() {
+ ArrayList newDoneTasks = new ArrayList<>();
+ for (Task task: listOfDoneTasks) {
+ if (isSameWeekAsToday(task.getDoneDate())) {
+ newDoneTasks.add(task);
+ }
+ }
+ return newDoneTasks;
+ }
+
+ private static boolean isSameWeekAsToday(LocalDate d) {
+ int todayWeek = getWeek(d);
+ return todayWeek == currentWeek;
+ }
+
+ //part of code snippet found at https://stackoverflow.com/questions/26012434/get-week-number-of-localdate-java-8/26013129
+ private static int getWeek(LocalDate d) {
+ TemporalField woy = WeekFields.of(Locale.getDefault()).weekOfWeekBasedYear();
+ int todayWeekNum = d.get(woy);
+ return todayWeekNum;
+ }
+}
diff --git a/src/main/java/resources/ToDos.java b/src/main/java/resources/ToDos.java
index 6b16695c9b..52047b155e 100644
--- a/src/main/java/resources/ToDos.java
+++ b/src/main/java/resources/ToDos.java
@@ -1,20 +1,20 @@
-package resources;
-
-/**
- * ToDo is a type of task that accepts /at statements only
- */
-public class ToDos extends Task {
- /**
- * Instantiates a new To dos.
- *
- * @param description the description
- */
- public ToDos(String description) {
- super(description);
- }
-
- @Override
- public String toString() {
- return "[T] " + super.toString();
- }
-}
+package resources;
+
+/**
+ * ToDo is a type of task that accepts /at statements only
+ */
+public class ToDos extends Task {
+ /**
+ * Instantiates a new To dos.
+ *
+ * @param description the description
+ */
+ public ToDos(String description) {
+ super(description);
+ }
+
+ @Override
+ public String toString() {
+ return "[T] " + super.toString();
+ }
+}
diff --git a/src/main/resources/view/DialogBox.fxml b/src/main/resources/view/DialogBox.fxml
index 98e64a4dc8..6759a68721 100644
--- a/src/main/resources/view/DialogBox.fxml
+++ b/src/main/resources/view/DialogBox.fxml
@@ -9,7 +9,7 @@
-