forked from nus-cs2113-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nus-cs2113-AY2324S1#13 from Cheezeblokz/Jingxi-Cal…
…endar Jingxi-Calendar
- Loading branch information
Showing
11 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package seedu.duke.calendar; | ||
|
||
public class Calendar { | ||
EventStorage eventStorage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package seedu.duke.calendar; | ||
|
||
public class CalendarCommandParser { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package seedu.duke.calendar; | ||
|
||
public class CalendarManager { | ||
Calendar calendar; | ||
CalendarUi calendarUi; | ||
CalendarCommandParser calendarCommandParser; | ||
|
||
public CalendarManager() { | ||
calendar = new Calendar(); | ||
calendarUi = new CalendarUi(); | ||
calendarCommandParser = new CalendarCommandParser(); | ||
} | ||
|
||
public void start() { | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package seedu.duke.calendar; | ||
|
||
public class CalendarUi { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package seedu.duke.calendar; | ||
|
||
import java.time.LocalDate; | ||
|
||
public class Event { | ||
String name; | ||
LocalDate from; | ||
LocalDate to; | ||
|
||
public Event(String name, LocalDate from, LocalDate to) { | ||
this.name = name; | ||
this.from = from; | ||
this.to = to; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public LocalDate getFrom() { | ||
return from; | ||
} | ||
|
||
public void setFrom(LocalDate from) { | ||
this.from = from; | ||
} | ||
|
||
public LocalDate getTo() { | ||
return to; | ||
} | ||
|
||
public void setTo(LocalDate to) { | ||
this.to = to; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Event{" + | ||
"name='" + name + '\'' + | ||
", from=" + from + | ||
", to=" + to + | ||
'}'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package seedu.duke.calendar; | ||
|
||
import java.time.LocalDate; | ||
import java.util.ArrayList; | ||
import java.util.TreeMap; | ||
|
||
public class EventStorage { | ||
ArrayList<Event> events; | ||
|
||
public EventStorage() { | ||
events = new ArrayList<>(); | ||
} | ||
|
||
public void addEvent(String name, LocalDate from, LocalDate to) { | ||
events.add(new Event(name, from, to)); | ||
} | ||
|
||
public boolean delEvent(String name) { | ||
for(Event event : events) { | ||
if (event.getName().equals(name)) { | ||
events.remove(event); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
@Override | ||
public String toString() { | ||
return "EventStorage{" + | ||
"events=" + events + | ||
'}'; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/seedu/duke/calendar/command/AddEventCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package seedu.duke.calendar.command; | ||
|
||
public class AddEventCommand extends EventCommand{ | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/seedu/duke/calendar/command/DeleteEventCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package seedu.duke.calendar.command; | ||
|
||
public class DeleteEventCommand extends EventCommand{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package seedu.duke.calendar.command; | ||
|
||
public abstract class EventCommand { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/seedu/duke/calendar/command/ListCalendarEventsCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package seedu.duke.calendar.command; | ||
|
||
public class ListCalendarEventsCommand extends EventCommand{ | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/seedu/duke/calendar/command/UnknownCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package seedu.duke.calendar.command; | ||
|
||
public class UnknownCommand extends EventCommand{ | ||
} |