public abstract class Restriction extends Object
Constructor and Description |
---|
Restriction(long id,
Offering offering)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addConfig(Config config)
Add a configuration (of the offering
getOffering() ) to this restriction |
void |
addSection(Section section)
Add a section (of the offering
getOffering() ) to this restriction. |
Set<Config> |
getConfigs()
One or more configurations on which the restriction is set.
|
long |
getId()
Restriction id
|
Offering |
getOffering()
Instructional offering on which the restriction is set.
|
Map<Subpart,Set<Section>> |
getSections()
One or more sections on which the restriction is set.
|
Set<Section> |
getSections(Subpart subpart)
One or more sections on which the restriction is set (optional).
|
abstract boolean |
isApplicable(Student student)
Returns true if the student is applicable for the restriction
|
boolean |
isIncluded(Config config) |
boolean |
isIncluded(Enrollment enrollment)
Return true if the given enrollment meets the restriction.
|
boolean |
isIncluded(Section section) |
public Restriction(long id, Offering offering)
id
- restriction unique idoffering
- instructional offering on which the restriction is setpublic long getId()
public abstract boolean isApplicable(Student student)
student
- a studentpublic Offering getOffering()
public Set<Config> getConfigs()
public void addConfig(Config config)
getOffering()
) to this restrictionconfig
- instructional offering configurationpublic Map<Subpart,Set<Section>> getSections()
public Set<Section> getSections(Subpart subpart)
subpart
- scheduling subpartpublic void addSection(Section section)
getOffering()
) to this restriction.
This will also add all parent sections and the appropriate configuration to the offering.section
- a class restrictionpublic boolean isIncluded(Enrollment enrollment)
enrollment
- given enrollmentpublic boolean isIncluded(Config config)
public boolean isIncluded(Section section)