forked from KByrne12/CSCI430_Project1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProduct.java
More file actions
57 lines (51 loc) · 1.31 KB
/
Product.java
File metadata and controls
57 lines (51 loc) · 1.31 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
import java.util.*;
import java.io.*;
public class Product implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private String id;
private int quantity;
private int price;
private static final String PRODUCT_STRING ="P";
private List waitlists = new LinkedList();
public Product (String name, String id, int quantity, int price) {
this.name = name;
this.quantity = quantity;
this.id = id;
this.price = price;
}
// public void waitlistItem(Waitlist waitlist) {
// waitlists.add(waitlist);
// }
public String getName(){
return name;
}
public String getId() {
return id;
}
public int getQuantity() {
return quantity;
}
public int getPrice() {
return price;
}
public void setName(String newName){
name = newName;
}
public void setId(String newId){
id = newId;
}
public void setQuantity(int newQuantity) {
quantity = newQuantity;
}
public void setPrice(int newPrice) {
price = newPrice;
}
// public boolean equals(String id) {
// return this.id.equals(id);
// }
public String toString() {
String PString = "Product id " + id + " Product name " + name + " quantity " + quantity + " price " + price;
return PString;
}
}