-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathProduct.java
55 lines (45 loc) · 951 Bytes
/
Product.java
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
package ie.dit;
import processing.data.*;
public class Product
{
private String name;
private float price;
public Product(String name, float price)
{
this.name = name;
this.price = price;
}
public String toString()
{
return name + "\t" + price;
}
public Product(TableRow tr)
{
// Constructor chaining
this(tr.getString("Name"), tr.getFloat("Price"));
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the price
*/
public float getPrice() {
return price;
}
/**
* @param price the price to set
*/
public void setPrice(float price) {
this.price = price;
}
}