The code for different owner operations mostly implemented
[RRRRHHHH_Code] / ruralHouses / src / domain / Owner.java
1 package domain;
2
3 import java.io.Serializable;
4 import java.util.Vector;
5
6 @SuppressWarnings("serial")
7 public class Owner implements Serializable {
8
9         private String bankAccount = "";
10         private String name = "";
11         private Vector<RuralHouse> ruralHouses;
12
13         public Owner(String name) {
14                 this.name = name;
15                 ruralHouses = new Vector<RuralHouse>();
16         }
17
18         public Owner(String name, String bankAccount) {
19                 this.bankAccount = bankAccount;
20                 this.name = name;
21                 ruralHouses = new Vector<RuralHouse>();
22         }
23
24         public String getName() {
25                 return this.name;
26         }
27
28         public void setName(String name) {
29                 this.name = name;
30         }
31
32         public String getBankAccount() {
33                 return this.bankAccount;
34         }
35
36         public void setBankAccount(String bankAccount) {
37                 this.bankAccount = bankAccount;
38         }
39
40         public Vector<RuralHouse> getRuralHouses() {
41                 return ruralHouses;
42         }
43
44         public RuralHouse addRuralHouse(int houseNumber, String town, int nRooms,
45                         int nKitchens, int nBaths, int nLivings, int nParkings) {
46                 RuralHouse rh = new RuralHouse(houseNumber, this, town, nRooms,
47                                 nKitchens, nBaths, nLivings, nParkings);
48                 ruralHouses.add(rh);
49                 return rh;
50         }
51
52         public RuralHouse addRuralHouse(int houseNumber, String description,
53                         String town, int nRooms, int nKitchens, int nBaths, int nLivings,
54                         int nParkings) {
55                 RuralHouse rh = new RuralHouse(houseNumber, this, description, town,
56                                 nRooms, nKitchens, nBaths, nLivings, nParkings);
57                 ruralHouses.add(rh);
58                 return rh;
59         }
60
61         public String toString() {
62                 return name;
63         }
64
65 }