java.lang.Object
page.codeberg.friedolyn.grades.Course
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe accounts that are part of this course and may contain their ownModules.private StringThe human-readable title of the course, e.g.private DegreeThe university degree that this course will lead to.The modules that are part of this course but not of anyaccounts.private final @NonNull ArrayList<Subaccount> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAccount(@NonNull Account account) Inserts a newAccountat the end of this course'saccounts list.voidaddAccounts(@NonNull Account... accounts) Inserts the specifiedAccounts at the end of this course'saccounts list.voidAdds aModuleto the end of this course'smodules list.voidaddModules(@NonNull Module... modules) Adds the specifiedModules to the end of this course'smodules list.voidaddSubaccount(@NonNull Subaccount subaccount) Inserts the specifiedSubaccountat the end of this course'ssubaccounts list.voidaddSubaccounts(@NonNull Subaccount... subaccounts) Inserts the specifiedSubaccounts at the end of this course'ssubaccounts list, in the given order.voidRemoves all accounts from this course'saccounts list.voidRemoves all modules from this course'smodules list.voidRemoves all subaccounts from this course'ssubaccounts list.booleanChecks whether the values of this course's fields are equal to their counterparts in the specified object (if it is aCourseat all).@NonNull ArrayList<Subaccount> @NonNull AccountremoveAccount(int index) Removes the account at the specified position in this course'saccounts list.booleanremoveAccount(@NonNull Account account) Removes the first occurrence of the specifiedAccountfrom this course'saccounts list, if it is present.removeAccounts(int... indices) Removes the accounts at the specified positions in this course'saccounts list.booleanremoveAccounts(@NonNull Account... accounts) Removes the specifiedAccounts from this course'saccounts list, if they are present.@NonNull ModuleremoveModule(int index) Removes the module at the specified position in this course'smodules list.booleanremoveModule(@NonNull Module module) Removes the first occurrence of the specifiedModulefrom this course'smodules list, if it is present.removeModules(int... indices) Removes the modules at the specified positions in this course'smodules list.booleanremoveModules(@NonNull Module... modules) Removes the specifiedModules from this course'smodules list, if they are present.@NonNull SubaccountremoveSubaccount(int index) Removes the subaccount at the specified position in this course'ssubaccounts list.booleanremoveSubaccount(@NonNull Subaccount subaccount) Removes the first occurrence of the specifiedSubaccountfrom this course'ssubaccounts list, if it is present.@NonNull ArrayList<Subaccount> removeSubaccounts(int... indices) Removes the subaccounts at the specified positions in this course'ssubaccounts list.booleanremoveSubaccounts(@NonNull Subaccount... subaccounts) Removes the specifiedSubaccounts from this course'ssubaccounts list, if they are present.voidsetCourseName(@NonNull String courseName) Updates the human-readable title of the course.voidUpdates thedegreethat this course will lead to.@NonNull StringtoString()
-
Field Details
-
degree
The university degree that this course will lead to. -
courseName
The human-readable title of the course, e.g.Angewandte Informatik. -
ACCOUNTS
-
SUBACCOUNTS
-
MODULES
-
-
Constructor Details
-
Course
public Course()
-
-
Method Details
-
getDegree
-
getCourseName
-
getAccounts
-
getSubaccounts
- Returns:
- The
subaccountsthat are part of this course.
-
getOrphanModules
-
getModules
-
setDegree
-
setCourseName
Updates the human-readable title of the course.- Parameters:
courseName- The new course name.
-
addAccount
Inserts a newAccountat the end of this course'saccounts list.- Parameters:
account- The account to add.
-
addAccounts
Inserts the specifiedAccounts at the end of this course'saccounts list.- Parameters:
accounts- The accounts to add.
-
removeAccount
Removes the first occurrence of the specifiedAccountfrom this course'saccounts list, if it is present.- Parameters:
account- The account to remove.- Returns:
trueif this list contained the specified element,falseotherwise.
-
removeAccounts
Removes the specifiedAccounts from this course'saccounts list, if they are present.- Parameters:
accounts- The accounts to remove.- Returns:
trueif this list was modified as a result of this operation.
-
removeAccount
Removes the account at the specified position in this course'saccounts list.- Parameters:
index- The index of the account to remove. Must be between 0 (inclusive) and the size of the list (exclusive).- Returns:
- The account previously at the specified position.
- Throws:
IndexOutOfBoundsException- If the index is out of range.
-
removeAccounts
@NonNull public @NonNull ArrayList<Account> removeAccounts(int... indices) throws IndexOutOfBoundsException Removes the accounts at the specified positions in this course'saccounts list.- Parameters:
indices- The indices of the accounts to remove. Must be between 0 (inclusive) and the size of the list (exclusive).- Returns:
- The accounts previously at the specified positions.
- Throws:
IndexOutOfBoundsException- If any of the indices are out of range.
-
clearAccounts
public void clearAccounts()Removes all accounts from this course'saccounts list. -
addSubaccount
Inserts the specifiedSubaccountat the end of this course'ssubaccounts list. -
addSubaccounts
Inserts the specifiedSubaccounts at the end of this course'ssubaccounts list, in the given order. -
removeSubaccount
Removes the first occurrence of the specifiedSubaccountfrom this course'ssubaccounts list, if it is present.- Parameters:
subaccount- The subaccount to remove.- Returns:
trueif this list contained the specified element,falseotherwise.
-
removeSubaccounts
Removes the specifiedSubaccounts from this course'ssubaccounts list, if they are present.- Parameters:
subaccounts- The subaccounts to remove.- Returns:
trueif this list was modified as a result of this operation.
-
removeSubaccount
Removes the subaccount at the specified position in this course'ssubaccounts list.- Parameters:
index- The index of the subaccount to remove. Must be between 0 (inclusive) and the size of the list (exclusive).- Returns:
- The subaccount previously at the specified position.
- Throws:
IndexOutOfBoundsException- If the index is out of range.
-
removeSubaccounts
@NonNull public @NonNull ArrayList<Subaccount> removeSubaccounts(int... indices) throws IndexOutOfBoundsException Removes the subaccounts at the specified positions in this course'ssubaccounts list.- Parameters:
indices- The indices of the subaccounts to remove. Must be between 0 (inclusive) and the size of the list (exclusive).- Returns:
- The subaccounts previously at the specified positions.
- Throws:
IndexOutOfBoundsException- If any of the indices are out of range.
-
clearSubaccounts
public void clearSubaccounts()Removes all subaccounts from this course'ssubaccounts list. -
addModule
Adds aModuleto the end of this course'smodules list.- Parameters:
module- The module to add.
-
addModules
Adds the specifiedModules to the end of this course'smodules list.- Parameters:
modules- The modules to add.
-
removeModule
Removes the first occurrence of the specifiedModulefrom this course'smodules list, if it is present.- Parameters:
module- The module to remove.- Returns:
trueif this list contained the specified element,falseotherwise.
-
removeModules
Removes the specifiedModules from this course'smodules list, if they are present.- Parameters:
modules- The modules to remove.- Returns:
trueif this list was modified as a result of this operation.
-
removeModule
Removes the module at the specified position in this course'smodules list.- Parameters:
index- The index of the module to remove. Must be between 0 (inclusive) and the size of the list (exclusive).- Returns:
- The module previously at the specified position.
- Throws:
IndexOutOfBoundsException- If the index is out of range.
-
removeModules
@NonNull public @NonNull ArrayList<Module> removeModules(int... indices) throws IndexOutOfBoundsException Removes the modules at the specified positions in this course'smodules list.- Parameters:
indices- The indices of the modules to remove. Must be between 0 (inclusive) and the size of the list (exclusive).- Returns:
- The modules previously at the specified positions.
- Throws:
IndexOutOfBoundsException- If any of the indices are out of range.
-
clearModules
public void clearModules()Removes all modules from this course'smodules list. -
equals
Checks whether the values of this course's fields are equal to their counterparts in the specified object (if it is aCourseat all). -
toString
-
