Class BudgetItem
java.lang.Object
no.ntnu.idatt1002.demo.data.budget.BudgetItem
This class represents a budgetItem. This is essentially a budget category
that user can add to their budgeting.
- Author:
- Adele
-
Constructor Summary
ConstructorsConstructorDescriptionBudgetItem(double budgetAmount, String description, ExpenseCategory category) The constructor of a new Budgetitem. -
Method Summary
Modifier and TypeMethodDescriptionbooleanjavafx.beans.property.DoublePropertyGets the amount property of its corresponding amount value.doubleThis method gets the BudgetAmount.This method gets the category.This method gets the description.javafx.beans.property.ObjectProperty<ExpenseCategory>Gets the category property of its corresponding category value.javafx.beans.property.StringPropertyGets the description property of its corresponding description value.inthashCode()voidsetBudgetAmount(double amount) Sets the amount to the value of the argument.voidsetBudgetCategory(ExpenseCategory category) Sets the budget category to the value of the argument.voidsetBudgetDescription(String description) Sets the budget description to the value of the argument.toString()
-
Constructor Details
-
BudgetItem
The constructor of a new Budgetitem.- Parameters:
budgetAmount- The amount of budget as a doubledescription- A description of the budget as a Stringcategory- A category from ExpenseCategory- Throws:
IllegalArgumentException- if the budgetAmount is less than zero.
-
-
Method Details
-
getBudgetAmount
public double getBudgetAmount()This method gets the BudgetAmount.- Returns:
- the budgetAmount as a double
-
getAmountProperty
public javafx.beans.property.DoubleProperty getAmountProperty()Gets the amount property of its corresponding amount value.- Returns:
- The amount property.
-
setBudgetAmount
public void setBudgetAmount(double amount) Sets the amount to the value of the argument.- Parameters:
amount- The value to which the amount will change.
-
getBudgetCategory
This method gets the category.- Returns:
- the category as one of the categories in ExpenseCategory
-
getCategoryProperty
Gets the category property of its corresponding category value.- Returns:
- The category property.
-
setBudgetCategory
Sets the budget category to the value of the argument.- Parameters:
category- Category to which the budget item will change.
-
getBudgetDescription
This method gets the description.- Returns:
- the description as a String.
-
getDescriptionProperty
public javafx.beans.property.StringProperty getDescriptionProperty()Gets the description property of its corresponding description value.- Returns:
- The description property.
-
setBudgetDescription
Sets the budget description to the value of the argument.- Parameters:
description- Description to which the budget description will change.
-
toString
-
equals
-
hashCode
public int hashCode()
-