public class SubstitutionScheduleDay
extends java.lang.Object
implements java.lang.Cloneable
SubstitutionSchedule and contains the corresponding substitutions and messages.| Constructor and Description |
|---|
SubstitutionScheduleDay() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllSubstitutions(java.util.Collection<? extends Substitution> substitutions)
Add multiple substitutions for this day
|
void |
addAllSubstitutions(Substitution... substitutions)
Add multiple substitutions for this day
|
void |
addMessage(java.lang.String message)
Add a message for this day.
|
void |
addSubstitution(Substitution substitution)
Add a substitution for this day
|
SubstitutionScheduleDay |
clone() |
boolean |
equals(java.lang.Object o) |
boolean |
equalsByDate(SubstitutionScheduleDay other)
Check if this day's date is equal to the one of another
SubstitutionScheduleDay. |
java.lang.String |
getComment()
Get the comment for this day (displayed next to the date - e.g.
|
org.joda.time.LocalDate |
getDate()
Get the date of this day.
|
java.lang.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.
|
java.lang.String |
getLastChangeString()
Get the date and time where this day on the schedule was last updated as a string representation.
|
java.util.List<java.lang.String> |
getMessages()
Get all messages for this day.
|
java.util.Set<Substitution> |
getSubstitutions()
Get all substitutions for this day
|
java.util.Set<Substitution> |
getSubstitutionsByClass(java.lang.String theClass) |
java.util.Set<Substitution> |
getSubstitutionsByClassAndExcludedSubject(java.lang.String theClass,
java.util.Set<java.lang.String> excludedSubjects)
Get only the substitutions that apply to the given class and that are not for one of the given subjects.
|
java.util.Set<Substitution> |
getSubstitutionsByTeacherAndExcludedSubject(java.lang.String teacher,
java.util.Set<java.lang.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 |
setComment(java.lang.String comment)
Set the comment for this day (displayed next to the date - e.g.
|
void |
setDate(org.joda.time.LocalDate date)
Set the date of this day.
|
void |
setDateString(java.lang.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(java.lang.String lastChangeString)
Set the date and time where this day on the schedule was last updated as a string representation.
|
void |
setSubstitutions(java.util.Set<Substitution> substitutions)
Set the substitutions for this day
|
java.lang.String |
toString() |
java.lang.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 java.lang.String getDateString()
public void setDateString(java.lang.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 java.lang.String getLastChangeString()
null if the last change date is only set for the whole schedule
(SubstitutionSchedule.getLastChangeString()).public void setLastChangeString(java.lang.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 java.util.Set<Substitution> getSubstitutions()
public void setSubstitutions(java.util.Set<Substitution> substitutions)
substitutions - the set of substitutions for this daypublic java.util.Set<Substitution> getSubstitutionsByClass(java.lang.String theClass)
public java.util.List<java.lang.String> getMessages()
<b>bold</b> and <i>italic</i>.public void addMessage(java.lang.String message)
<b>bold</b> and <i>italic</i>.message - the message to addpublic java.lang.String getComment()
public void setComment(java.lang.String comment)
comment - the comment for this daypublic void addSubstitution(Substitution substitution)
substitution - the substitution to addpublic void addAllSubstitutions(Substitution... substitutions)
substitutions - the substitutions to addpublic void addAllSubstitutions(java.util.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 java.util.Set<Substitution> getSubstitutionsByClassAndExcludedSubject(java.lang.String theClass, java.util.Set<java.lang.String> excludedSubjects)
theClass - the class to find substitutions forexcludedSubjects - the subjects to excludepublic java.util.Set<Substitution> getSubstitutionsByTeacherAndExcludedSubject(java.lang.String teacher, java.util.Set<java.lang.String> excludedSubjects)
teacher - the teacher to find substitutions forexcludedSubjects - the subjects to excludepublic SubstitutionScheduleDay clone()
clone in class java.lang.Objectpublic java.lang.String toString(SubstitutionSchedule.Type type)
type - the type of the SubstitutionSchedule. Affects the format in which the single
Substitutions are outputpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object