diff --git a/src/main/java/seedu/taskman/model/event/Schedule.java b/src/main/java/seedu/taskman/model/event/Schedule.java index ddeaa71034be..b39bfd8f7c52 100644 --- a/src/main/java/seedu/taskman/model/event/Schedule.java +++ b/src/main/java/seedu/taskman/model/event/Schedule.java @@ -49,6 +49,7 @@ public String toString() { public static final String ERROR_FORMAT_BAD_DURATION = String.format(Messages.MESSAGE_INVALID_ARGUMENTS, "Bad duration, %1$s"); + //@@author A0139019E private static final String SCHEDULE_DIVIDER_GROUP = "((?:, )|(?: to )|(?: for ))"; private static final String SCHEDULE_VALIDATION_REGEX = "(.*?)" + SCHEDULE_DIVIDER_GROUP + "(.*)"; @@ -72,13 +73,10 @@ public Schedule(long startEpochSecond, long endEpochSecond) throws IllegalValueE * Parses a string in natural language to create a schedule object * A schedule consists of a start & end time * - * Three formats are accepted: - * "start time, end time", - * "start time to end time", - * "start time for duration" + * Refer to Schedule.MESSAGE_SCHEDULE_CONSTRAINS for accepted formats * - * @throws IllegalValueException when input strays from the formats, - * or when the start/end time/duration cannot be parsed + * @throws IllegalValueException when input strays from the accepted formats, + * or when the start,end time or duration cannot be parsed */ public Schedule(String schedule) throws IllegalValueException { schedule = schedule.trim(); @@ -168,6 +166,8 @@ private long convertRawDurationToEndTime(String rawDuration, long startEpochSeco } } + //@@author + @Override public String toString() { return Formatter.appendWithNewlines( @@ -270,6 +270,7 @@ public String getFormalEndString(){ return DateTimeParser.epochSecondToFormalDateTime(endEpochSecond); } + //@@author A0139019E @Override public boolean equals(Object o) { if (this == o) return true; @@ -284,4 +285,5 @@ public int hashCode() { return Objects.hashCode(startEpochSecond, endEpochSecond); } + //@@author }