Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package HomePlanner;
- import javafx.beans.property.DoubleProperty;
- import javafx.beans.property.StringProperty;
- import java.time.LocalDate;
- import java.util.ArrayList;
- import java.util.Date;
- /**
- * Created by mscib on 11.08.2016.
- */
- public class User {
- private ArrayList<Expenses> listOfExpenses = new ArrayList<>();
- private DoubleProperty cash;
- public double getCash() {
- return cash.get();
- }
- public DoubleProperty cashProperty() {
- return cash;
- }
- public void setCash(double cash) {
- this.cash.set(cash);
- }
- public void addExpense(String name, String category, LocalDate date, double cost){
- if(name != null && category != null && date != null && (cash.getValue()-cost)>0){
- Expenses exp = new Expenses(category,name,cost,date);
- listOfExpenses.add(exp);
- }
- }
- public User(double cash){
- setCash(cash);
- }
- }
Add Comment
Please, Sign In to add comment