Class Overview

java.lang.Object
no.ntnu.idatt1002.demo.data.economics.Overview

public class Overview extends Object
Class for getting an overview on your total revenue.
Author:
andreas
  • Constructor Details

    • Overview

      public Overview(GeneralBudget budget)
      Class constructor that take in a GeneralBudget and creates an empty incomeRegister, expenseRegister and set totalRevenue to zero.
      Parameters:
      budget - the GeneralBudget you want to overview.
    • Overview

      public Overview(IncomeRegister incomeRegister, ExpenseRegister expenseRegister, GeneralBudget budget)
      Class constructor that takes in an incomeRegister and expenseRegister and calculates total balance based on them.
      Parameters:
      incomeRegister - the incomeRegister you want to overview.
      expenseRegister - the expenseRegister you want to overview.
      budget - the GeneralBudget you want to overview.
  • Method Details

    • getIncomeRegister

      public IncomeRegister getIncomeRegister()
      Get the IncomeRegister of the Overview.
      Returns:
      IncomeRegister
    • getExpenseRegister

      public ExpenseRegister getExpenseRegister()
      Get the ExpenseRegister of the Overview.
      Returns:
      ExpenseRegister
    • getBudget

      public GeneralBudget getBudget()
      Get the GeneralBudget of the Overview.
      Returns:
      GeneralBudget
    • getTotalBalance

      public double getTotalBalance()
      Get the total revenue of overview.
      Returns:
      the overview´s total revenue.
    • updateBalance

      public void updateBalance()
      Method for updating the total balance by taking the max amount of the budget minus the total sum of the expense register.
    • getPercentageOfTotalBalance

      public double getPercentageOfTotalBalance(double percentage)
      Method for getting a percentage of the total revenue.
      Parameters:
      percentage - the percentage you want to get.
      Returns:
      a percentage of total revenue.
    • getBudgetItemMinusExpense

      public double getBudgetItemMinusExpense(ExpenseCategory category) throws IllegalArgumentException
      Method for getting Expense subtracted from a BudgetItem for a specific ExpenseCategory.
      Parameters:
      category - the ExpenseCategory you want to use.
      Returns:
      Expense subtracted from BudgetItem for category.
      Throws:
      IllegalArgumentException - if there is no Budget for budget category.
    • hasUsedUpBudgetItem

      public boolean hasUsedUpBudgetItem(ExpenseCategory category)
      Method for checking if you have used up a specific BudgetItem.
      Parameters:
      category - the ExpenseCategory you want to check.
      Returns:
      true or false depending on if you have used it up.