| Modifier and Type | Class and Description |
|---|---|
static class |
SubstitutionSchedule.Type
Represents the type of a substitution schedule
|
| Constructor and Description |
|---|
SubstitutionSchedule() |
SubstitutionSchedule(SubstitutionSchedule other)
Creates a new SubstitutionSchedule containing the same data as the given one
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAdditionalInfo(AdditionalInfo info)
Add an additional info to this schedule
|
void |
addDay(SubstitutionScheduleDay newDay)
Add a day to this substitution schedule
|
SubstitutionSchedule |
clone() |
boolean |
equals(Object o) |
static Set<Substitution> |
filterByClass(String theClass,
Set<Substitution> substitutions)
Filter a set of substitutions by class
|
protected void |
filterByClassAndExcludedSubject(SubstitutionSchedule filteredSchedule,
String theClass,
Set<String> excludedSubjects) |
static Set<Substitution> |
filterBySubject(Set<String> excludedSubjects,
Set<Substitution> substitutions)
Filter a set of substitutions by excluding a set of subjects
|
static Set<Substitution> |
filterByTeacher(String teacher,
Set<Substitution> substitutions)
Filter a set of substitutions by teacher
|
protected void |
filterByTeacherAndExcludedSubject(SubstitutionSchedule filteredSchedule,
String teacher,
Set<String> excludedSubjects) |
SubstitutionSchedule |
filteredByClassAndExcludedSubject(String theClass,
Set<String> excludedSubjects)
Get a new schedule that only contains the data that applies to the specified class, excluding substitutions
for the specified subjects.
|
SubstitutionSchedule |
filteredByTeacherAndExcludedSubject(String teacher,
Set<String> excludedSubjects)
Get a new schedule that only contains the data that applies to the specified teacher, excluding substitutions
for the specified subjects.
|
static SubstitutionSchedule |
fromData(SubstitutionScheduleData scheduleData)
Initialize a SubstitutionSchedule with the correct type taken from a
SubstitutionScheduleData |
List<AdditionalInfo> |
getAdditionalInfos()
Get the list of additional infos on this schedule
|
List<String> |
getClasses()
Get the list of classes that can appear on this schedule.
|
List<SubstitutionScheduleDay> |
getDays()
Get the list of days included in this schedule
|
org.joda.time.LocalDateTime |
getLastChange()
Get the date and time where this schedule was last updated.
|
String |
getLastChangeString()
Get the date and time where this schedule was last updated as a string representation
|
List<String> |
getTeachers()
Get the list of teachers that can appear on this schedule.
|
SubstitutionSchedule.Type |
getType()
Get the type of this schedule
|
String |
getWebsite()
Get the website where this schedule can be found online
|
int |
hashCode() |
void |
setClasses(List<String> classes)
Set the list of classes.
|
void |
setLastChange(org.joda.time.LocalDateTime lastChange)
Set the date and time where this schedule was last updated.
|
void |
setLastChangeString(String lastChangeString)
Set the date and time where this schedule was last updated as a string representation.
|
void |
setTeachers(List<String> teachers)
Set the list of teachers.
|
void |
setType(SubstitutionSchedule.Type type)
Set the type of this schedule
|
void |
setWebsite(String website)
Set the website where this schedule can be found online
|
String |
toString() |
public SubstitutionSchedule()
public SubstitutionSchedule(SubstitutionSchedule other)
other - the SubstitutionSchedule whose data to usepublic static SubstitutionSchedule fromData(SubstitutionScheduleData scheduleData)
SubstitutionScheduleDatascheduleData - a SubstitutionScheduleData to create a schedule forpublic static Set<Substitution> filterByClass(String theClass, Set<Substitution> substitutions)
theClass - the name of a classsubstitutions - a set of Substitutionspublic static Set<Substitution> filterBySubject(Set<String> excludedSubjects, Set<Substitution> substitutions)
excludedSubjects - a set of subjects to excludesubstitutions - a set of Substitutionspublic static Set<Substitution> filterByTeacher(String teacher, Set<Substitution> substitutions)
teacher - a teacher's name/abbreviationsubstitutions - a set of Substitutionspublic SubstitutionSchedule.Type getType()
public void setType(SubstitutionSchedule.Type type)
type - the type of this schedulepublic org.joda.time.LocalDateTime getLastChange()
getLastChangeString().public void setLastChange(org.joda.time.LocalDateTime lastChange)
setLastChangeString(String) to specify a string representation. If you used
SubstitutionScheduleDay.setLastChange(LocalDateTime), this will automatically be set
to the newest date of all the days.lastChange - the date and time where this schedule was last updated.public String getLastChangeString()
public void setLastChangeString(String lastChangeString)
setLastChange(LocalDateTime) instead.lastChangeString - the date and time where this schedule was last updated, as a string representationpublic String getWebsite()
public void setWebsite(String website)
website - the website URlpublic List<SubstitutionScheduleDay> getDays()
public void addDay(SubstitutionScheduleDay newDay)
newDay - the day to addpublic List<AdditionalInfo> getAdditionalInfos()
public void addAdditionalInfo(AdditionalInfo info)
info - the additional info to addpublic List<String> getClasses()
SubstitutionSchedule.Type.TEACHER
schedulepublic void setClasses(List<String> classes)
SubstitutionSchedule.Type.TEACHER schedule.classes - the list of classes to set.public List<String> getTeachers()
SubstitutionSchedule.Type.TEACHER
schedule.public void setTeachers(List<String> teachers)
SubstitutionSchedule.Type.TEACHER schedule.teachers - the list of teachers to set.public SubstitutionSchedule clone()
public SubstitutionSchedule filteredByClassAndExcludedSubject(String theClass, Set<String> excludedSubjects)
theClass - the class whose substitutions should be includedexcludedSubjects - the subjects that should be excludedprotected void filterByClassAndExcludedSubject(SubstitutionSchedule filteredSchedule, String theClass, Set<String> excludedSubjects)
public SubstitutionSchedule filteredByTeacherAndExcludedSubject(String teacher, Set<String> excludedSubjects)
teacher - the teacher whose substitutions should be includedexcludedSubjects - the subjects that should be excludedprotected void filterByTeacherAndExcludedSubject(SubstitutionSchedule filteredSchedule, String teacher, Set<String> excludedSubjects)