Class BudgetRegister
java.lang.Object
no.ntnu.idatt1002.demo.data.budget.BudgetRegister
Class for containing and organizing budget names. A budget name is the name that is given to a
budget when it is created.
- Since:
- 19.04.2023
- Author:
- Harry Linrui Xu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBudgetName
(String name) Method for adding a budget name to the register.Gets a list of the budget names contained in the budget register.void
removeBudgetName
(String name) Method for removing a budget name from the register.toString()
-
Constructor Details
-
BudgetRegister
public BudgetRegister()Constructor for the register. Instantiates the arraylist that contains all budget names.
-
-
Method Details
-
getBudgetNames
Gets a list of the budget names contained in the budget register.- Returns:
- Deep copied list of budget names.
-
addBudgetName
Method for adding a budget name to the register.- Parameters:
name
- The name of the budget.- Throws:
IllegalArgumentException
- If name is null, blank or already exists within the register.
-
removeBudgetName
Method for removing a budget name from the register.- Parameters:
name
- The name of the budget.- Throws:
IllegalArgumentException
- If name is null or blank.
-
toString
-