public class SubstitutionScheduleDay extends Object implements Cloneable
SubstitutionSchedule and contains the corresponding substitutions and messages.| Constructor and Description |
|---|
SubstitutionScheduleDay() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllSubstitutions(Collection<? extends Substitution> substitutions)
Add multiple substitutions for this day
|
void |
addAllSubstitutions(Substitution... substitutions)
Add multiple substitutions for this day
|
void |
addMessage(String message)
Add a message for this day.
|
void |
addSubstitution(Substitution substitution)
Add a substitution for this day
|
SubstitutionScheduleDay |
clone() |
boolean |
equals(Object o) |
boolean |
equalsByDate(SubstitutionScheduleDay other)
Check if this day's date is equal to the one of another
SubstitutionScheduleDay. |
org.joda.time.LocalDate |
getDate()
Get the date of this day.
|
String |
getDateString()
Get the date of this day, as a string representation
|
org.joda.time.LocalDateTime |
getLastChange()
Get the date and time where this day on the schedule was last updated.
|
String |
getLastChangeString()
Get the date and time where this day on the schedule was last updated as a string representation.
|
List<String> |
getMessages()
Get all messages for this day.
|
Set<Substitution> |
getSubstitutions()
Get all substitutions for this day
|
Set<Substitution> |
getSubstitutionsByClass(String theClass) |
Set<Substitution> |
getSubstitutionsByClassAndExcludedSubject(String theClass,
Set<String> excludedSubjects)
Get only the substitutions that apply to the given class and that are not for one of the given subjects.
|
Set<Substitution> |
getSubstitutionsByTeacherAndExcludedSubject(String teacher,
Set<String> excludedSubjects)
Get only the substitutions that apply to the given teacher and that are not for one of the given subjects.
|
int |
hashCode() |
void |
merge(SubstitutionScheduleDay day)
Merge substitutions from this day with those from another
SubstitutionScheduleDay. |
void |
setDate(org.joda.time.LocalDate date)
Set the date of this day.
|
void |
setDateString(String dateString)
Set the date of this day a string representation.
|
void |
setLastChange(org.joda.time.LocalDateTime lastChange)
Set the date and time where this day on the schedule was last updated.
|
void |
setLastChangeString(String lastChangeString)
Set the date and time where this day on the schedule was last updated as a string representation.
|
void |
setSubstitutions(Set<Substitution> substitutions)
Set the substitutions for this day
|
String |
toString() |
String |
toString(SubstitutionSchedule.Type type)
Get a string representation of the day, using different wording depending on the type.
|
public org.joda.time.LocalDate getDate()
getDateString().public void setDate(org.joda.time.LocalDate date)
setDateString(String) to specify a string representation.date - the datepublic String getDateString()
public void setDateString(String dateString)
setDate(LocalDate), you do
not need to add this.dateString - the date of this day, as a string representation@Nullable public org.joda.time.LocalDateTime getLastChange()
getLastChangeString(). May be null if the last
change date is only set for the whole schedule (SubstitutionSchedule.getLastChange()).public void setLastChange(org.joda.time.LocalDateTime lastChange)
setLastChangeString(String) to specify a string representation. If the last change date is only
available for the whole schedule, use SubstitutionSchedule.setLastChange(LocalDateTime)lastChange - the date and time where this day was last updated.@Nullable public String getLastChangeString()
null if the last change date is only set for the whole schedule
(SubstitutionSchedule.getLastChangeString()).public void setLastChangeString(String lastChangeString)
setLastChange(LocalDateTime) instead. If the last change date is only
available for the whole schedule, use SubstitutionSchedule.setLastChangeString(String)lastChangeString - the date and time where this day was last updated, as a string representationpublic Set<Substitution> getSubstitutions()
public void setSubstitutions(Set<Substitution> substitutions)
substitutions - the set of substitutions for this daypublic Set<Substitution> getSubstitutionsByClass(String theClass)
public List<String> getMessages()
<b>bold</b> and <i>italic</i>.public void addMessage(String message)
<b>bold</b> and <i>italic</i>.message - the message to addpublic void addSubstitution(Substitution substitution)
substitution - the substitution to addpublic void addAllSubstitutions(Substitution... substitutions)
substitutions - the substitutions to addpublic void addAllSubstitutions(Collection<? extends Substitution> substitutions)
substitutions - the substitutions to addpublic void merge(SubstitutionScheduleDay day)
SubstitutionScheduleDay. Both must have the
same date.day - the day to merge with this daypublic boolean equalsByDate(SubstitutionScheduleDay other)
SubstitutionScheduleDay. Also works if only
the string representation is specified (setDateString(String)).other - the day to compare with this onepublic Set<Substitution> getSubstitutionsByClassAndExcludedSubject(String theClass, Set<String> excludedSubjects)
theClass - the class to find substitutions forexcludedSubjects - the subjects to excludepublic Set<Substitution> getSubstitutionsByTeacherAndExcludedSubject(String teacher, Set<String> excludedSubjects)
teacher - the teacher to find substitutions forexcludedSubjects - the subjects to excludepublic SubstitutionScheduleDay clone()
public String toString(SubstitutionSchedule.Type type)
type - the type of the SubstitutionSchedule. Affects the format in which the single
Substitutions are output