Skip to content

Commit f47fe32

Browse files
PluiexoPluiexo
Pluiexo
authored and
Pluiexo
committed
Tidy JavaDocs
1 parent 6ec69dd commit f47fe32

File tree

7 files changed

+28
-26
lines changed

7 files changed

+28
-26
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# plato.Plato project template
1+
# Plato project template
22

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

55
## Setting up in Intellij
66

@@ -13,12 +13,13 @@ Prerequisites: JDK 11, update Intellij to the most recent version.
1313
1. If there are any further prompts, accept the defaults.
1414
1. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
1515
In the same dialog, set the **Project language level** field to the `SDK default` option.
16-
3. After that, locate the `src/main/java/plato.Plato.java` file, right-click it, and choose `Run plato.Plato.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
16+
3. After that, locate the `src/main/java/plato/Launcher.java` file, right-click it, and choose `Run plato.Launcher.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see a GUI window.
1717
```
1818
Hello from
19-
____ _
20-
| _ \ _ _| | _____
21-
| | | | | | | |/ / _ \
22-
| |_| | |_| | < __/
23-
|____/ \__,_|_|\_\___|
24-
```
19+
.______ __ ___ .___________. ______
20+
| _ \ | | / \ | | / __ \
21+
| |_) | | | / ^ \ `---| |----`| | | |
22+
| ___/ | | / /_\ \ | | | | | |
23+
| | | `----./ _____ \ | | | `--' |
24+
| _| |_______/__/ \__\ |__| \______/
25+
```

docs/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ Usage:
8282

8383
Examples:
8484

85-
* `event cs2103 planning /from 1800 24/02/24 /to 1900 27/02/24`
85+
* `event cs2103 planning /from 1800 23/02/24 /to 1900 27/02/24`
8686

87-
* `event midterm study session /from 01:00pm 28-02-24 /to 02:00pm 30-02-24`
87+
* `event midterm study session /from 01:00pm 28-02-24 /to 02:00pm 01-03-24`
8888

8989
Expected outcome:
9090
```
9191
Got it. I've added this task:
92-
[E][ ] cs2103 planning (from:23-02-2024 18:00)
92+
[E][ ] cs2103 planning (from:23-02-2024 18:00 to: 27-02-24 19:00)
9393
Now you got 3 tasks in your list.
9494
```
9595
### Specification for `[DateTimeFormat]`
@@ -150,7 +150,7 @@ delete [INDEX]
150150
Examples:
151151
```
152152
mark 1
153-
delete 3
153+
delete 2
154154
```
155155

156156
Expected outcome:
@@ -159,8 +159,8 @@ Nice! I've marked this task as done:
159159
[T][X] Cook dinner
160160
161161
Noted. I've removed this task
162-
[E][ ] cs2103 planning (from:23-02-2024 18:00)
163-
Now you have 2 taks in the list
162+
[D][ ] cs3230 (by:23-02-2024 23:59)
163+
Now you have 2 tasks in the list
164164
```
165165
---
166166

@@ -176,7 +176,7 @@ Usage: `find [KEYWORD]`
176176

177177
### View
178178

179-
View the all the task being scheduled on that date.
179+
View the all the task being scheduled on that date. For event task view command only checks the to dateline of the task.
180180

181181
Usage: `view [DateFormats]`
182182

@@ -187,7 +187,7 @@ Usage: `view [DateFormats]`
187187
Examples:
188188
```
189189
find Cook
190-
view 23-02-24
190+
view 27-02-24
191191
```
192192

193193
Expected outcome:
@@ -196,7 +196,7 @@ Here are the matching task in your list:
196196
1. [T][X] Cook dinner
197197
198198
Here are the task scheduled on that date:
199-
1. [E][ ] cs2103 planning (from:23-02-2024 18:00)
199+
1. [E][ ] cs2103 planning (from:23-02-2024 18:00 to: 27-02-24 19:00)
200200
```
201201

202202
---

src/main/java/plato/parser/DateHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class DateHandler {
1717
//Inspired from: https://www.baeldung.com/java-date-regular-expressions
1818
private static final Pattern PATTERN_DATE =
19-
Pattern.compile("([a-zA-Z]+)?\\s?(?<d>\\d{1,2})[-/](?<m>\\d{1,2})[-/](?<y>\\d{2,4})\\s?([a-zA-Z]+)?");
19+
Pattern.compile("([a-zA-Z]+)?\\s?(?<date>(?<d>\\d{1,2})[-/](?<m>\\d{1,2})[-/](?<y>\\d{2,4}))\\s?([a-zA-Z]+)?");
2020
private static final Pattern TIME_PATTERN =
2121
Pattern.compile("(.+)?\\s?(?<time>(\\d{2}:?\\d{2}))(?<indicator>(?i)\\s?[ap]m)?\\s?(.+)?");
2222
private static final DateTimeFormatter FORMAT_DATE = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
@@ -64,7 +64,7 @@ public static Optional<LocalTime> checkTime(String testTime) throws PlatoExcepti
6464
//Remove the date so that it is easier to check for the time, and prevent conflicts
6565
Matcher removeDate = PATTERN_DATE.matcher(testTime);
6666
if (removeDate.find()) {
67-
testTime = testTime.replaceAll(removeDate.group(), "");
67+
testTime = testTime.replaceAll(removeDate.group("date"), "");
6868
}
6969

7070
Matcher match = TIME_PATTERN.matcher(testTime);

src/main/java/plato/parser/Parser.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public static String[] parse(String command, TaskManager manager) throws PlatoEx
6060

6161

6262
/**
63-
* @return Whether plato should close the chat-bot.
63+
* Checks if should close the bot.
64+
* @return Whether plato should close the chat bot.
6465
*/
6566
public static boolean isExit() {
6667
return isDead;

src/main/java/plato/task/Actions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package plato.task;
22

33
/**
4-
* Actions indicate teh type of task
4+
* Actions indicate the type of task.
55
*/
66
public enum Actions {
77
TODO, DEADLINE, EVENT

src/main/java/plato/task/TaskManager.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,9 @@ public String[] queryTasks(Query act, String instruction) throws PlatoException
278278
* @return A list of items containing the search results.
279279
*/
280280
public String[] findTask(String search) {
281-
List<String> foundTask =
282-
items.stream().map(Task::toString).filter(string -> string.contains(search)).collect(Collectors.toList());
281+
List<String> foundTask = items.stream().map(Task::toString).filter(string -> string.toLowerCase()
282+
.contains(search))
283+
.collect(Collectors.toList());
283284

284285
if (!foundTask.isEmpty()) {
285286
List<String> print = iterateWithIndex(foundTask);
@@ -301,7 +302,7 @@ public String[] findTask(String search) {
301302
*/
302303
public String[] viewByDate(String date) throws PlatoException {
303304
LocalDate inputDate = DateHandler.checkDate(date).orElseThrow(() -> new PlatoException("dateError"));
304-
System.out.println(inputDate);
305+
305306
List<String> foundDates =
306307
items.stream().filter(item -> isMatchDate(item.getType(), item, inputDate)).map(Task::toString)
307308
.collect(Collectors.toList());

src/main/java/plato/task/Todo.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package plato.task;
22

3-
43
/**
54
* Create a todo class that only has a name.
65
*/

0 commit comments

Comments
 (0)