Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Alaukik Pant] iP #79

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f38b4b9
Level-0
alaukiknpant Jan 26, 2020
17f4cc5
Level-1
alaukiknpant Jan 26, 2020
55725fd
Level-2
alaukiknpant Jan 26, 2020
deb9f4f
Level-3
alaukiknpant Jan 27, 2020
e0a3b3a
A-CodingStandard
alaukiknpant Jan 30, 2020
b7d710b
Level 4
alaukiknpant Feb 6, 2020
6670b40
A-CodeQuality
alaukiknpant Feb 7, 2020
442def3
A-TextUiTesting
alaukiknpant Feb 7, 2020
4e84374
Level-5 Exceptions added to Level-5 branch
alaukiknpant Feb 13, 2020
3ff8cdc
Merge branch 'Level-5'
alaukiknpant Feb 13, 2020
df51cae
fixing a bug in Level-5
alaukiknpant Feb 13, 2020
35fd723
Making small edits to level 5
alaukiknpant Feb 16, 2020
734813f
A-packages edits
alaukiknpant Feb 16, 2020
6217e7c
Level six changes and small change in markAsDone method
alaukiknpant Feb 16, 2020
8deb898
Level-7 saving features
alaukiknpant Feb 17, 2020
9cbed26
Merge tag 'Level-6'
alaukiknpant Feb 17, 2020
fcd1a9d
files edited!
alaukiknpant Feb 20, 2020
b605af7
Making Sure Dates are saves before implementing more OOP
alaukiknpant Feb 21, 2020
694f939
Text-UI
alaukiknpant Feb 21, 2020
29b26a5
saving features added to OOP
alaukiknpant Feb 22, 2020
f13dde4
A-MoreOOP
alaukiknpant Feb 23, 2020
9d83899
Level-9 find function
alaukiknpant Feb 23, 2020
5b3e4aa
Level-8 date, time and exception handling
alaukiknpant Feb 23, 2020
6a90f7d
branch-A-Java-Doc edits
alaukiknpant Feb 24, 2020
77522b4
Merge pull request #2 from alaukiknpant/Level-9
alaukiknpant Feb 24, 2020
0814181
Merge branch 'master' into Level-8
alaukiknpant Feb 24, 2020
75bf6ea
Merge pull request #3 from alaukiknpant/Level-8
alaukiknpant Feb 24, 2020
13c4f55
Editing PR request from Level-8
alaukiknpant Feb 28, 2020
0c209f0
A-JavaDoc
alaukiknpant Feb 28, 2020
cf5bae8
no message
alaukiknpant Feb 28, 2020
634e155
no message
alaukiknpant Feb 28, 2020
d6b65f5
Merge branch 'branch-A-JavaDoc'
alaukiknpant Feb 28, 2020
0c715c2
Improving code quality according to coding standards.
alaukiknpant Feb 29, 2020
2bec58b
removing automated testing
alaukiknpant Feb 29, 2020
900f0ef
User Guide
alaukiknpant Feb 29, 2020
1be8345
Updating user guide.
alaukiknpant Feb 29, 2020
71d5643
Set theme jekyll-theme-hacker
alaukiknpant Feb 29, 2020
0a95fd2
no message
alaukiknpant Feb 29, 2020
80a83d4
Merge branch 'master' of https://github.com/alaukiknpant/duke
alaukiknpant Feb 29, 2020
e075e28
User guide updates
alaukiknpant Feb 29, 2020
94107a9
A-UserGuide
alaukiknpant Mar 1, 2020
6faacf2
Updating user guide and bye message
alaukiknpant Mar 1, 2020
e378b7a
A-Release
alaukiknpant Mar 1, 2020
1d962d3
Update README.md
alaukiknpant Mar 1, 2020
43d632c
Update README.md
alaukiknpant Mar 1, 2020
4b517a1
Changes to ensure there are no compatibility issues reading the cross…
alaukiknpant Mar 1, 2020
54602a7
Merge branch 'master' of https://github.com/alaukiknpant/duke
alaukiknpant Mar 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-hacker
228 changes: 218 additions & 10 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,228 @@
# User Guide
# [Project Hiroshi](https://github.com/alaukiknpant/duke) - User Guide

## Features
By: `Alaukik Nath Pant` Since: `Feb 2020` Licence: `MIT` Course: `CS2113`

### Feature 1
Description of feature.
## Introduction

## Usage
Hiroshi Nagai Task Tracker(HNTT) is for those who *prefer to use a desktop app for managing their tasks*.
It is worth noting that HNTT is *optimized for those who prefer to work with a Command Line Interface* (CLI).
It helps you save todos, events and deadlines.

### `Keyword` - Describe action
## Quick Start

Describe action and its outcome.
* Ensure you have Java `11` or above installed in your Computer.
* Download the latest `hiroshi.jar` [latest reslease here!](https://github.com/alaukiknpant/duke/releases/tag/v0.2).
* Copy the file to the folder you want to use as the home folder for your Task tracker.
* Go to the directory where the Jar file is stored and type: `java -jar Hiroshi.jar`
* When the application executes, all possible commands that can help you manage your tasks are shown.
*Some example commands you can try:
* **`list`** : lists all tasks that have been added and saved. until now
* **`todo`**`finish all your Computer Science homework` : adds a todo task with the corresponding description to the Task List.
* **`delete`**`1` : deletes the 1st item in your current task list
* **`bye`** : exits the app

Example of usage:

`keyword (optional arguments)`
## Features


### Command Format

* The words in `UPPER_CASE` are to be supplied by the user e.g. in `todo TASK`, `TASK` is a parameter which can be used to add a task `todo Go Running`.
* The date for tasks of type `deadline` and `event` are labelled as `DATE`, which is of the format `YYYY-MM-DD`: `deadline TASK \by DATE`, `event TASK \at DATE`.
* The `TASK_NUMBER` is the interger index of a task in the tasklist and is of the format `delete TASKNUMBER`, `done TASK_NUMBER`.
* The `KEY_WORD` is the string that you are searching for in the task list.`find food`, `find homework`.
* The `TASK_NUMBER` refers to the index number shown in the displayed task list. Remember that the index *must be a positive integer* 1, 2, 3, ...

#### Adding a todo task : `todo`

* Adds a todo task to the tasklist
* Format: `todo TASK`

[TIP]
A todo task just needs to be a string but cannot be empty.

Examples:

todo eat


Expected Outcome:

Got it. I have added this task:

[T] [x] eat

Now you have 2 item/s in the list`

****

#### Adding a deadline task: `deadline `

* Adds a dedline to the tasklist
* Format: `deadline TASK /by DATE`

[TIP]
A deadline task must necessarily have a date mentioned.

Examples:

deadline eat /by 2019-01-02

Expected Outcome

Got it. I have added this task:

[D] [x] eat (by: Jan 2 2019)

Now you have 3 item/s in the list

****

#### Adding an `event` task: `event `

* Adds a event to the tasklist
* Format: `event TASK /at DATE`

[TIP]
A event task must necessarily have a date mentioned.

Examples:

event eat /at 2019-01-05

Expected Outcome:

Got it. I have added this task:

[E] [x] eat (at: Jan 5 2019)

Now you have 3 item/s in the list

****

#### Deleting a task : `delete`

* Deletes the task at the specified `TASK_NUMBER`.
* When a task is deleted, all subsequest tasks in the task list will have their index reduced by 1.
* Format: `delete TASK_NUMBER`

Examples:

delete 2

Expected Outcome

Cool, we will remove the following task:
[D] [x] eat (by: Jan 2 2019)
Now you have 2 items in your list
****

#### Listing all tasks in the tasklist : `list`

* Shows a list of all tasks in tasklist.
* Format: `list`

Examples:

list

Expected outcome:

`outcome`
1. [T] [x] eat
2. [E] [x] eat (at: Jan 5 2019)


****

#### Marking a task as done : `done`

* Marks the task at the specified `TASK_NUMBER` as done. The task number refers to the index number shown in the displayed task list. Remember that the index *must be a positive integer* 1, 2, 3, ...
* If a task is already marked as done, the app remarks it as done again.
* Format: `done TASK_NUMBER`


Examples:

done 2

Expected Outcome:

2. [E][v] eat (at: Jan 5 2019)
Done! We have checked 2!

****

#### Locating a task by key word: `find`

* Finds tasks whose description contains a specified keyword. The search is case sensitive. e.g `run` will not match `Run`
* Format: `find KEYWORD`

Examples:

find eat

Expected Outcome:

Here are the matching tasks in your list:
1. [T] [x] eat
2. [E] [v] eat (at: Jan 5 2019)

There were 2 tasks with the "eat" keyword
****

#### Clearing the task list : `clear`

* Clears all the tasks in task list.
* Format: `clear`

Examples:

clear

Expected Ourcome:

TaskList is now Empty

****

#### Exiting the program : `bye`

* Exits the program.
* Format: `bye`

Examples:

* `bye`

Expected Ourcome:

Bye. Hope to see you again soon!

****--****--****--****--****--****--****--****--****--****--****--****--****--***

****

## FAQ

*Q*: How do I transfer my data to another Computer? +
*A*: Copy the text file called "files" that has saved your task list into the directory from which you will run the application in your new computer. You are then set to go!

## Command Summary
* *Todo* : `todo TASK`;
e.g. `todo Run beside Clementi Park.`
* *Deadline* : `deadline TASK /by DATE`;
eg. `deadline Problem Set 2 \by 2020-01-02`
* *Event* : `event TASK /at DATE`;
eg. `event Marathon \at 2020-01-01`
* *List* : `list`
* *Done* : `done TASK_NUMBER`;
eg. `done 2`
* *Delete* : `delete TASK_NUMBER`;
e.g. `delete 3`
* *Find* : `find KEYWORD`;
e.g. `find eat`
* *Clear* : `clear`
* *Exit* : `bye`

## Acknowledgement
My UserGuide has been heavily inspired by the superb format of the AddressBook user guide that we were given access to for this course.
1 change: 1 addition & 0 deletions files/TaskList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

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

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: hiroshi.Hiroshi

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

import hiroshi.commands.Commands;
import hiroshi.commands.RunCommand;
import hiroshi.storage.Storage;
import hiroshi.tasklist.TaskList;
import hiroshi.tasks.Task;
import hiroshi.ui.Ui;
import hiroshi.parser.Parser;

import java.util.ArrayList;


/**
* <h1>Hiroshi Nagai Task Tracker Chatbot</h1>
* Entry point of the "Hiroshi Nagai" Task Tracker application.
* Initializes the application and starts the interaction with the user.
* <b>Note:</b> This application is written for CS2113 at the NUS School of computing.
* @author Alaukik Nath Pant
* @since 2020-02-24
*/
public class Hiroshi {

/** Version info of the program. */
public static final String VERSION = "Hiroshi Nagai - Version 2.0";

private Ui ui;
private Storage storage;
private TaskList taskList;

/** Constructor that runs the program.
* @param filePath String that represents the relative path to the file that stores all the tasks.
*/
public Hiroshi(String filePath ) {
ui = new Ui();
taskList = new TaskList();
storage = new Storage(filePath);
this.run(TaskList.taskList, filePath);
}

/**
* Gets the program started by creating a tasklist with the tasks given in the file.
* Reads the user command and executes it, until the user issues the exit("bye") command.
*
* @param taskList List that stores the tasks mentioned until now.
* @param filePath String that represents the relative path to the file that stores all the tasks.
*/
public void run(ArrayList<Task> taskList, String filePath) {
boolean isExit = false;
while (!isExit){
String command = Ui.readCommand();
RunCommand c = new RunCommand(command, taskList, filePath);
c.execute(Commands.finalCommand, taskList, filePath);
isExit = c.isExit(Commands.finalCommand);
}
Ui.printStraightLine();
Ui.showByeMessage();
}

public static void main(String[] args) {
String filePath = Parser.returnFilePath("files/TaskList.txt");
new Hiroshi(filePath);
}
}
35 changes: 35 additions & 0 deletions src/main/java/hiroshi/commands/AddCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package hiroshi.commands;

import hiroshi.tasklist.AddTasks;
import hiroshi.tasks.Task;
import hiroshi.ui.Ui;

import java.util.ArrayList;

/** Represents command that is used to call a method to add tasks to taskList. */
public class AddCommand extends Commands {

public AddCommand(String command, ArrayList<Task> taskList, String filePath) {
super(command, taskList,filePath);
}

/**
* Calls a method to add tasks to taskList and prints the revalent message about the task that has been added.
*
* @param taskList List that stores the tasks mentioned until now.
* @param ogString Original command that was fed to the user.
* @param taskType The type of the task to be added, eg: Todo, Event, Deadline.
*/
public static void execute(ArrayList<Task> taskList, String ogString, String taskType) {
try {
try {
AddTasks.execute(taskList, ogString, taskType);
Ui.printAddedStatement(taskList);
} catch (java.time.format.DateTimeParseException ex) {
Ui.markDateTimeException();
}
} catch (IndexOutOfBoundsException e) {
Ui.markAsIncorrectFormat();
}
}
}
30 changes: 30 additions & 0 deletions src/main/java/hiroshi/commands/ClearCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package hiroshi.commands;

import hiroshi.parser.Parser;
import hiroshi.tasklist.ClearTasks;
import hiroshi.tasks.Task;
import hiroshi.ui.Ui;

import java.util.ArrayList;

/** Represents command that is used to call a method to clear all tasks from taskList. */
public class ClearCommand extends Commands{

public ClearCommand(String command, ArrayList<Task> taskList, String taskType) {
super(command, taskList,taskType);
}

/**
* Calls a method to clear all tasks from a taskList.
*
* @param taskList List that stores the tasks mentioned until now.
* @param ogString Original command that was fed to the user.
*/
public static void execute(ArrayList<Task> taskList, String ogString) {
if (Parser.isClearStatementCorrect(ogString)) {
ClearTasks.execute(taskList);
System.out.println("TaskList is now Empty");
Ui.printStraightLine();
}
}
}
Loading