Repository navigation
Expand file tree
/
Copy pathTransactionData.java
More file actions
56 lines (49 loc) · 1.88 KB
/
Copy pathTransactionData.java
File metadata and controls
56 lines (49 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package restaurant;
/**
* This file is the data portion of the TransactionNode.
*
* @author Mary Buist
* @author Kushi Sharma
*/
public class TransactionData {
private String type; // one of three: order, donation, restock
private String item; // either food order or ingredient donation request/ restock
private int amount; // quantity of food being purchased/donated/restocked
private double profit; // profit? (+/-)
private boolean success; // true if successfull transaction, false otherwise
/*
* Default constructor
*/
public TransactionData (){
type = null;
item = null;
amount = 0;
profit = 0;
success = false;
}
/*
* Constructor
* @param type one of three: order, donation, restock
* @param item
* @param amount quantity of food being purchased/donated/restocked
* @param profit positive amount for orders, negative amount for donation and restocks
* @param success true if successfull transaction, false otherwise
*/
public TransactionData(String type, String item, int amount, double profit, boolean success){
this.type = type;
this.item = item;
this.amount = amount;
this.profit = profit;
this.success = success;
}
// Getter and Setter Methods
public String getType() { return type;}
public String getItem() { return item;}
public int getAmount() { return amount;}
public Double getProfit() { return profit;}
public boolean getSuccess() { return success;}
public void setType(String typeInput) {type = typeInput;}
public void setItem(String itemInput) {item = itemInput;}
public void setProfit(double profitInput) {profit = profitInput;}
public void setSuccess(boolean successInput) {success = successInput;}
}