Class BudgetingCell
java.lang.Object
no.ntnu.idatt1002.spendwise.budgeting.BudgetingCell
Class that defines the cells in the budgeting table.
-
Constructor Summary
ConstructorDescriptionBudgetingCell
(double expected, double actual, Category category) Constructor for the BudgetingCell class.BudgetingCell
(double actual, Category category) Constructor for the BudgetingCell class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the actual amount of money spent.Returns the category of the cell.double
Returns the difference between the expected and actual amount of money spent.double
Returns the expected amount of money to spend.void
setActual
(double newActual) Sets the actual amount of money spent.void
setExpected
(double newExpected) Sets the expected amount of money to spend.
-
Constructor Details
-
BudgetingCell
Constructor for the BudgetingCell class.- Parameters:
expected
- Expected amount of money to spend.actual
- Actual amount of money spent.category
- Category of the cell.
-
BudgetingCell
Constructor for the BudgetingCell class.- Parameters:
actual
- Actual amount of money spent.category
- Category of the cell.
-
-
Method Details
-
getExpected
public double getExpected()Returns the expected amount of money to spend.- Returns:
- Expected amount of money to spend as a double.
-
setExpected
public void setExpected(double newExpected) Sets the expected amount of money to spend.- Parameters:
newExpected
- Expected amount of money to spend as a double.
-
getActual
public double getActual()Returns the actual amount of money spent.- Returns:
- Actual amount of money spent as a double.
-
setActual
public void setActual(double newActual) Sets the actual amount of money spent.- Parameters:
newActual
- Actual amount of money spent as a double.
-
getCategoryName
Returns the category of the cell.- Returns:
- Category of the cell as a string.
-
getDifference
public double getDifference()Returns the difference between the expected and actual amount of money spent.- Returns:
- Difference between the expected and actual amount of money spent as a double.
-