public class Model
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Model()
Constructor for the MOdel.
|
Modifier and Type | Method and Description |
---|---|
void |
addAssistant(Assistant assistant)
Adds the supplied assistant to the list of assistants that are currently in the model.
|
void |
addConstraint(Constraint c)
Adds the given constraint to the model
|
void |
addInstructor(Instructor i)
Adds a new Instructor to the model.
|
void |
addSchedule(Schedule aSchedule)
Adds the supplied schedule to the model.
|
void |
addSection(Section s)
Adds a new Section to the model, adding appropriate references to other components
in the Model that require them.
|
void |
addSkill(Skill aSkill)
Adds the specified skill to the model.
|
void |
addTime(TimeBlock atime)
Adds the specified time to the model.
|
void |
createDummyData()
Create some filler data for simple testing purposes.
|
Assistant |
getAssistant(int assistantIndex)
Retrieves a the assistant at the specified index from the list of assistants.
|
Assistant |
getAssistantByName(java.lang.String s)
Returns the assistant in the model that has the same name
as the one that is supplied, if it exists in the model.
|
Assistant |
getAssistantByUsername(java.lang.String s)
Returns the assistant in the model that has the same
username as the one supplied, if it exists in the model.
|
java.util.ArrayList<Assistant> |
getAssistants()
Gets the list of assistants that are currently in the model.
|
Assistant[] |
getAssistantsArray()
Returns the list of assistants in the model as an array, rather than
as an arraylist.
|
int |
getAssistantsCount()
Gets the number of assistants that are currently in the model.
|
java.util.ArrayList<Constraint> |
getConstraints()
Gets all of the constraints currently in the model.
|
Schedule |
getFinalizedSchedule()
Retrieves the schedules in the list of schedules
that are marked as finalized.
|
java.util.ArrayList<Instructor> |
getInstructors()
Gets the list of instructors that are currently in the model.
|
Position |
getPositionAt(int row)
Looking at the ordered list of sections and their consistent ordering of Positions,
returns a specific Position.
|
Position |
getPositionById(java.lang.String p)
Returns the position in the model that has the same
ID as the one supplied, if it exists in the model.
|
Position[] |
getPositions()
Gets all of the positions currently in the model.
|
Schedule |
getPublishedSchedule()
Retrieves a the schedules in the list of schedules
that are marked as published.
|
java.util.ArrayList<Schedule> |
getSchedules()
Gets the list of all schedules in the model.
|
java.util.ArrayList<Section> |
getSections()
Gets the list of all of the sections currently in the model.
|
Section[] |
getSectionsArray()
Returns the list of sections in the modeel as an array,
rather than as an arrayList.
|
java.lang.String |
getSemester()
Gets the current semester.
|
Skill |
getSkillByName(java.lang.String selectedSkill)
Returns the skill in the model that has the same name as
the name that is supplied, if it exists in the model.
|
java.util.ArrayList<Skill> |
getSkills()
Gets the list of skills that are currently stored in the model.
|
java.util.ArrayList<Section> |
getSortedSections()
Returns the sections that are currently in the model
they are sorted alphabetically.
|
boolean |
isActive()
Retrieves the activity state of the model.
|
void |
loadModel(Model newModel)
Replaces all the data in the model with the data from the given model
|
void |
removeAssistant(Assistant a)
Not only removes the assistant from the Model, but also ensures that there
are no references to the Assistant in any component of the model.
|
void |
removeInstructor(Instructor i)
Removes an instructor from the Model, also ensuring that there
are no references to the instructor in any component of the Model.
|
void |
removeLAPosition(Position position)
Removes the specified position from the list of available
la positions from the model.
|
void |
removeSchedule(Schedule s)
Removes a Schedule from the Model, ensuring that there are no references to the
Schedule elsewhere in the model.
|
void |
removeSection(Section s)
Removes a section from the Model, also ensuring that there
are no references to the section in any component of the Model.
|
void |
removeSkill(Skill selectedSkill)
Removes the skill of the name matching the supplied name
from the model.
|
void |
removeTAPosition(Position position)
Removes the specified position from the list of available
ta positions from the model.
|
void |
renameAssistant(Assistant a,
java.lang.String name)
Renames an assistant to a specified name.
|
void |
renameInstructor(Instructor i,
java.lang.String name)
Rename the instructor to a given name.
|
void |
renameSchedule(Schedule s,
java.lang.String name)
Renames the schedule to a specified name.
|
void |
renameSection(Section s,
java.lang.String name)
Renames a Section to a specified name.
|
void |
setActive(boolean active)
Sets the activity state of the model.
|
void |
setAssistants(java.util.ArrayList<Assistant> assistants)
Sets the list of assistants that are currently in the model to the list supplied.
|
void |
setConstraints(java.util.ArrayList<Constraint> constraints)
Sets the constraints currently in the model to the supplied list.
|
void |
setInstructors(java.util.ArrayList<Instructor> instructors)
Sets the list of instructors currently in the model to the list that is supplied.
|
void |
setSchedules(java.util.ArrayList<Schedule> schedules)
Sets the list of schedules that are currently in the model to the list supplied.
|
void |
setSections(java.util.ArrayList<Section> sections)
Sets the list of sections in the model to the list supplied.
|
void |
setSemester(java.lang.String semester)
Sets the current semester to the one specified.
|
boolean |
skillExists(Skill newSkill)
Queries the model to find if a skill of the same name
as the one supplied exists.
|
boolean |
skillReferenced(Skill selectedSkill)
Queries the model to see if the skill of the supplied name
is referenced.
|
public void addSkill(Skill aSkill)
aSkill
- public void addTime(TimeBlock atime)
atime
- public java.util.ArrayList<Skill> getSkills()
public Position[] getPositions()
public java.util.ArrayList<Constraint> getConstraints()
public void setConstraints(java.util.ArrayList<Constraint> constraints)
constraints
- public java.util.ArrayList<Section> getSections()
public void setSections(java.util.ArrayList<Section> sections)
sections
- public java.util.ArrayList<Schedule> getSchedules()
public void setSchedules(java.util.ArrayList<Schedule> schedules)
schedules
- public void setAssistants(java.util.ArrayList<Assistant> assistants)
assistants
- public void setSemester(java.lang.String semester)
semester
- public java.lang.String getSemester()
public void createDummyData()
public void addConstraint(Constraint c)
c
- public void addSchedule(Schedule aSchedule)
aSchedule
- public java.util.ArrayList<Assistant> getAssistants()
public void addAssistant(Assistant assistant)
assistant
- public void setInstructors(java.util.ArrayList<Instructor> instructors)
instructors
- public java.util.ArrayList<Instructor> getInstructors()
public int getAssistantsCount()
public Assistant getAssistant(int assistantIndex)
assistantIndex
- public Assistant[] getAssistantsArray()
public Section[] getSectionsArray()
public void addSection(Section s)
s
- public void addInstructor(Instructor i)
i
- public Schedule getPublishedSchedule()
public Schedule getFinalizedSchedule()
public Skill getSkillByName(java.lang.String selectedSkill)
selectedSkill
- public Assistant getAssistantByName(java.lang.String s)
s
- public Assistant getAssistantByUsername(java.lang.String s)
s
- public Position getPositionById(java.lang.String p)
p
- public void removeAssistant(Assistant a)
a
- public void renameAssistant(Assistant a, java.lang.String name)
a
- name
- public void removeInstructor(Instructor i)
i
- public void renameInstructor(Instructor i, java.lang.String name)
i
- name
- public void removeSection(Section s)
s
- public void renameSection(Section s, java.lang.String name)
s
- name
- public void removeSchedule(Schedule s)
s
- public void renameSchedule(Schedule s, java.lang.String name)
s
- name
- public Position getPositionAt(int row)
row
- public void loadModel(Model newModel)
newModel
- public java.util.ArrayList<Section> getSortedSections()
public boolean skillExists(Skill newSkill)
newSkill
- public boolean skillReferenced(Skill selectedSkill)
selectedSkill
- public void removeSkill(Skill selectedSkill)
selectedSkill
- public void setActive(boolean active)
active
- public boolean isActive()
public void removeTAPosition(Position position)
position
- public void removeLAPosition(Position position)
position
-