java.lang.Object
edu.ntnu.idata1002.prosjekt2021.model.SectionList
public class SectionList
extends java.lang.Object
Represents a list over sections.
-
Constructor Summary
Constructors Constructor Description SectionList()
Creates a new instance of sectionlist. -
Method Summary
Modifier and Type Method Description void
addSection(Section section)
Adds a new section to the section list.Section
findSectionBySectionName(java.lang.String sectionName)
Iterates over the sectionlist and returns the first section with the name given.java.util.ArrayList<Section>
getSections()
Returns a list with all the sections.void
removeSection(Section section)
Removes a section from the section list.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SectionList
public SectionList()Creates a new instance of sectionlist.
-
-
Method Details
-
addSection
Adds a new section to the section list.- Parameters:
section
- section to be added to the section list.
-
removeSection
Removes a section from the section list.- Parameters:
section
- section to be removed from the section list.- Throws:
RemoveException
- if the section did not get removed.
-
findSectionBySectionName
Iterates over the sectionlist and returns the first section with the name given.- Parameters:
sectionName
- name of the section to search for.- Returns:
- section with the matching name, null if no section matches.
-
getSections
Returns a list with all the sections.- Returns:
- a list with all the sections.
-