Line | |
---|
1 | package main;
|
---|
2 |
|
---|
3 | public class WineBottle {
|
---|
4 | private String name, vineyard, country, region, variety, date_added, imageName;
|
---|
5 | private int vintage, price, size;
|
---|
6 | boolean selected;
|
---|
7 |
|
---|
8 | public WineBottle(String name, String vineyard, int vintage, String country, String region, String variety, String date_added, int size, int price, String imageName) {
|
---|
9 | this.name = name;
|
---|
10 | this.vineyard = vineyard;
|
---|
11 | this.vintage = vintage;
|
---|
12 | this.country = country;
|
---|
13 | this.region = region;
|
---|
14 | this.variety = variety;
|
---|
15 | this.price = price;
|
---|
16 | this.size = size;
|
---|
17 | this.imageName = imageName;
|
---|
18 | selected = false;
|
---|
19 |
|
---|
20 | date_added = (date_added.substring(5)+"-"+date_added.substring(0, 4)).replace('-', '/');
|
---|
21 | this.date_added = date_added;
|
---|
22 | }
|
---|
23 |
|
---|
24 | public String getName() {
|
---|
25 | return name;
|
---|
26 | }
|
---|
27 |
|
---|
28 | public String getVineyard() {
|
---|
29 | return vineyard;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public int getVintage() {
|
---|
33 | return vintage;
|
---|
34 | }
|
---|
35 |
|
---|
36 | public String getCountry() {
|
---|
37 | return country;
|
---|
38 | }
|
---|
39 |
|
---|
40 | public String getRegion() {
|
---|
41 | return region;
|
---|
42 | }
|
---|
43 |
|
---|
44 | public String getVariety() {
|
---|
45 | return variety;
|
---|
46 | }
|
---|
47 |
|
---|
48 | public String getDateAdded() {
|
---|
49 | return date_added;
|
---|
50 | }
|
---|
51 |
|
---|
52 | public int getSize() {
|
---|
53 | return size;
|
---|
54 | }
|
---|
55 |
|
---|
56 | public int getPrice() {
|
---|
57 | return price;
|
---|
58 | }
|
---|
59 |
|
---|
60 | public String getImageName() {
|
---|
61 | return imageName;
|
---|
62 | }
|
---|
63 |
|
---|
64 | public boolean isSelected() {
|
---|
65 | return selected;
|
---|
66 | }
|
---|
67 |
|
---|
68 | public void select() {
|
---|
69 | selected = true;
|
---|
70 | }
|
---|
71 |
|
---|
72 | public void unselect() {
|
---|
73 | selected = false;
|
---|
74 | }
|
---|
75 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.