Class ExpenseRegister
java.lang.Object
no.ntnu.idatt1002.demo.data.economics.ItemRegister<Expense>
no.ntnu.idatt1002.demo.data.economics.ExpenseRegister
ExpenseRegister is a class for storing Expenses. Subclass of ItemRegister.
- Author:
- andreas
-
Constructor Summary
ConstructorsConstructorDescriptionClass constructor that creates an empty List for storing Expense.ExpenseRegister
(List<Expense> expenses) Class constructor that takes in a List of Expense as argument. -
Method Summary
Modifier and TypeMethodDescriptiongetExpenseByCategory
(ExpenseCategory category) Method for getting every Expense in a given ExpenseCategory.getExpenseByMonth
(YearMonth yearMonth) Get the Expenses that are registered with a date corresponding to the given month and year.Get the Expenses that are recurring.Methods inherited from class no.ntnu.idatt1002.demo.data.economics.ItemRegister
addItem, getItems, getTotalSum, isEmpty, removeItem, toString
-
Constructor Details
-
ExpenseRegister
public ExpenseRegister()Class constructor that creates an empty List for storing Expense. -
ExpenseRegister
Class constructor that takes in a List of Expense as argument.- Parameters:
expenses
- the List of Expense you want to register.
-
-
Method Details
-
getExpenseByCategory
Method for getting every Expense in a given ExpenseCategory.- Parameters:
category
- the ExpenseCategory you want to get every Expense of.- Returns:
- a new ExpenseRegister of every Expense with category.
-
getExpenseByMonth
Get the Expenses that are registered with a date corresponding to the given month and year.- Parameters:
yearMonth
- month and year for which to withdraw Expenses.- Returns:
- list of Expenses for a certain month and year.
-
getRecurringExpense
Get the Expenses that are recurring.- Returns:
- a new ExpenseRegister of recurring Expenses.
-