Class ExpenseRegister

java.lang.Object
no.ntnu.idatt1002.demo.data.economics.ItemRegister<Expense>
no.ntnu.idatt1002.demo.data.economics.ExpenseRegister

public class ExpenseRegister extends ItemRegister<Expense>
ExpenseRegister is a class for storing Expenses. Subclass of ItemRegister.
Author:
andreas
  • Constructor Details

    • ExpenseRegister

      public ExpenseRegister()
      Class constructor that creates an empty List for storing Expense.
    • ExpenseRegister

      public ExpenseRegister(List<Expense> expenses)
      Class constructor that takes in a List of Expense as argument.
      Parameters:
      expenses - the List of Expense you want to register.
  • Method Details

    • getExpenseByCategory

      public ExpenseRegister getExpenseByCategory(ExpenseCategory category)
      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

      public ExpenseRegister getExpenseByMonth(YearMonth yearMonth)
      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

      public ExpenseRegister getRecurringExpense()
      Get the Expenses that are recurring.
      Returns:
      a new ExpenseRegister of recurring Expenses.