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