Skip to content

Commit a8f0822

Browse files
committed
- fixed gradle code formatting errors
1 parent 7cd4dda commit a8f0822

14 files changed

+46
-35
lines changed

data/flashcards/flashcard.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
11 | f | dfdf | 5
77
12 | dfdf | | 5
88
13 | 1 | j | 5
9+
14 | Hello | Duke | 5

src/main/java/seedu/duke/calendar/CalendarCommandParser.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22

33
package seedu.duke.calendar;
44

5-
import seedu.duke.calendar.command.*;
5+
import seedu.duke.calendar.command.AddEventCommand;
6+
import seedu.duke.calendar.command.AddGoalEventCommand;
7+
import seedu.duke.calendar.command.DeleteEventCommand;
8+
import seedu.duke.calendar.command.EventCommand;
9+
import seedu.duke.calendar.command.FindEventCommand;
10+
import seedu.duke.calendar.command.DeleteAllEventsCommand;
11+
import seedu.duke.calendar.command.ListCalendarEventsCommand;
12+
import seedu.duke.calendar.command.UnknownCommand;
613

7-
import seedu.duke.calendar.Exceptions.AddEventException;
8-
import seedu.duke.calendar.Exceptions.DeleteEventException;
9-
import seedu.duke.calendar.Exceptions.DeleteAllException;
10-
import seedu.duke.calendar.Exceptions.FindEventException;
11-
import seedu.duke.calendar.Exceptions.ListEventException;
14+
import seedu.duke.calendar.exceptions.AddEventException;
15+
import seedu.duke.calendar.exceptions.DeleteEventException;
16+
import seedu.duke.calendar.exceptions.DeleteAllException;
17+
import seedu.duke.calendar.exceptions.FindEventException;
18+
import seedu.duke.calendar.exceptions.ListEventException;
1219

1320
import java.util.Scanner;
1421

src/main/java/seedu/duke/calendar/command/AddEventCommand.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ public AddEventCommand(String input) {
1818
this.input = input;
1919
beginnerCommandLength = 2;
2020
expertCommandLength = 5;
21-
syntaxString = "add event EVENT_NAME EVENT_START_DATE (in format yyyy-mm-ddThh:mm:ss) EVENT_END_DATE (in format yyyy-mm-ddThh:mm:ss)";
21+
syntaxString = "add event EVENT_NAME EVENT_START_DATE (in format yyyy-mm-ddThh:mm:ss) " +
22+
"EVENT_END_DATE (in format yyyy-mm-ddThh:mm:ss)";
2223
}
2324

2425
//@@author kherlenbayasgalan
2526
/**
26-
* The executeBeginnerMode method is used to add an event to the calendar. It has two parameters (Scanner, EventList).
27-
* The EventList is used to add an event to the list. The scanner is used to get the user's event name input.
28-
* The method first takes the event name, then through parseDateTimeInput, it gets an acceptable date/time
29-
* from the user. If the user inserts acceptable inputs, the event will be added. If the user doesn't,
30-
* either one of DateTimeParseException or Invalid input exception.
27+
* The executeBeginnerMode method is used to add an event to the calendar.
28+
* It has two parameters (Scanner, EventList). The EventList is used to add an
29+
* event to the list. The scanner is used to get the user's event name input.
30+
* The method first takes the event name, then through parseDateTimeInput,
31+
* it gets an acceptable date/time from the user. If the user inserts acceptable inputs,
32+
* the event will be added. If the user doesn't, either one of DateTimeParseException
33+
* or Invalid input exception.
3134
* @param scanner is used to get user's event name.
3235
* @param eventList is used to add an event to the list.
3336
*/
@@ -38,8 +41,10 @@ public void executeBeginnerMode(Scanner scanner, EventList eventList) {
3841
String eventName = scanner.nextLine();
3942

4043
// checks if the acceptable format is given by the user to prevent program crash
41-
LocalDateTime startTime = parseDateTimeInput(scanner, "When does it start? (yyyy-MM-ddTHH:mm:ss) (e.g., 2023-12-20T12:30:30): ");
42-
LocalDateTime endTime = parseDateTimeInput(scanner, "When does it end? (yyyy-MM-ddTHH:mm:ss) (e.g., 2023-12-20T12:30:30): ");
44+
LocalDateTime startTime = parseDateTimeInput(scanner,
45+
"When does it start? (yyyy-MM-ddTHH:mm:ss) (e.g., 2023-12-20T12:30:30): ");
46+
LocalDateTime endTime = parseDateTimeInput(scanner,
47+
"When does it end? (yyyy-MM-ddTHH:mm:ss) (e.g., 2023-12-20T12:30:30): ");
4348

4449
if (endTime.isAfter(startTime)) {
4550
Event event = new Event(eventName, startTime, endTime);
@@ -63,7 +68,8 @@ protected void executeExpertMode(Scanner scanner, EventList eventList) {
6368
eventList.addEvent(event);
6469
System.out.println(event + " has been added to your Calendar");
6570
} else {
66-
System.out.println(" End time is before or equal to the start time. Please enter the correct end time.");
71+
System.out.println(" End time is before or equal to the start time. " +
72+
"Please enter the correct end time.");
6773
}
6874
} catch (DateTimeParseException e) {
6975
System.out.println(" Invalid date and time format. Please try again.");

src/main/java/seedu/duke/calendar/command/AddGoalEventCommand.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ public void executeBeginnerMode(Scanner scanner, EventList eventList) {
2323
System.out.print("What's the goal event name?: ");
2424
String eventName = scanner.nextLine();
2525

26-
LocalDateTime endTime = parseDateTimeInput(scanner, "When does it end? (yyyy-MM-ddTHH:mm:ss) (e.g., 2023-12-20T12:30:30): ");
27-
int goal = parseIntegerInput(scanner, "How many flashcard to review by then?: ");
26+
LocalDateTime endTime = parseDateTimeInput(scanner,
27+
"When does it end? (yyyy-MM-ddTHH:mm:ss) (e.g., 2023-12-20T12:30:30): ");
28+
int goal = parseIntegerInput(scanner,
29+
"How many flashcard to review by then?: ");
2830

2931
if (endTime.isAfter(LocalDateTime.now())) {
3032
Event event = new Goal(eventName, endTime, goal, 0);

src/main/java/seedu/duke/calendar/command/DeleteEventCommand.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package seedu.duke.calendar.command;
44

55
import seedu.duke.calendar.EventList;
6-
import seedu.duke.calendar.Event;
76

87
import java.util.Scanner;
98

@@ -16,14 +15,14 @@ public DeleteEventCommand(String input) {
1615
syntaxString = "delete event EVENT_NAME";
1716
}
1817

19-
/**
20-
* The execute method is used to delete an specified event from the EventList.
21-
* It takes two parameters (Scanner , EventList). The method takes in the event name,
22-
* then calls the deleteEvent function to search and delete the event.
23-
* If the event is not in the EventList, then "event doesn't exist" message will be displayed.
24-
* @param scanner is used to get user's desired event to be deleted.
25-
* @param eventList is used to delete the specified event from the EventList.
26-
*/
18+
/**
19+
* The execute method is used to delete an specified event from the EventList.
20+
* It takes two parameters (Scanner , EventList). The method takes in the event name,
21+
* then calls the deleteEvent function to search and delete the event.
22+
* If the event is not in the EventList, then "event doesn't exist" message will be displayed.
23+
* @param scanner is used to get user's desired event to be deleted.
24+
* @param eventList is used to delete the specified event from the EventList.
25+
*/
2726

2827
@Override
2928
protected void executeBeginnerMode(Scanner scanner, EventList eventList) {

src/main/java/seedu/duke/calendar/command/FindEventCommand.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
package seedu.duke.calendar.command;
44

5-
import seedu.duke.calendar.Event;
65
import seedu.duke.calendar.EventList;
76

87
import java.util.Scanner;

src/main/java/seedu/duke/calendar/Exceptions/AddEventException.java renamed to src/main/java/seedu/duke/calendar/exceptions/AddEventException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package seedu.duke.calendar.Exceptions;
1+
package seedu.duke.calendar.exceptions;
22

33
/**
44
* The AddEventException class is used for handling exceptions related with adding an event

src/main/java/seedu/duke/calendar/Exceptions/DeleteAllException.java renamed to src/main/java/seedu/duke/calendar/exceptions/DeleteAllException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package seedu.duke.calendar.Exceptions;
1+
package seedu.duke.calendar.exceptions;
22

33
/**
44
* The DeleteAllException class is used for handling exceptions related with deleting all events.

src/main/java/seedu/duke/calendar/Exceptions/DeleteEventException.java renamed to src/main/java/seedu/duke/calendar/exceptions/DeleteEventException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package seedu.duke.calendar.Exceptions;
1+
package seedu.duke.calendar.exceptions;
22

33
/**
44
* The DeleteEventException class is used for handling exceptions related with deleting an event

src/main/java/seedu/duke/calendar/Exceptions/FindEventException.java renamed to src/main/java/seedu/duke/calendar/exceptions/FindEventException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package seedu.duke.calendar.Exceptions;
1+
package seedu.duke.calendar.exceptions;
22

33
/**
44
* The FindEventException class is used for handling exceptions related with finding an event.

0 commit comments

Comments
 (0)