-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlace.java
More file actions
46 lines (46 loc) · 1.38 KB
/
Copy pathPlace.java
File metadata and controls
46 lines (46 loc) · 1.38 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
package lab4;
import java.util.Objects;
public class Place extends Entity implements Placeable{
public Place(Territory city) {
super(city.getName() + " в незаданном доме в незаданном месте");
this.city = city;
this.house = new House("незаданный дом");
this.specificPlace = "в незаданном месте";
}
public Place(Territory city, House house) {
super(city.getName() + " " + house + " в незаданном месте");
this.city = city;
this.house = house;
this.specificPlace = "в незаданном месте";
}
public Place(Territory city, House house, String specificPlace) {
super(city.getName() + " " + house + " " + specificPlace);
this.city = city;
this.house = house;
this.specificPlace = specificPlace;
}
private Territory city;
private House house;
private String specificPlace;
public void setCity(Territory city) {
this.city = city;
}
public Territory getCity() {
return city;
}
public void setHouse(House house){
this.house = house;
}
public House getHouse() {
return house;
}
public void setSpecificPlace(String specificPlace){
this.specificPlace = specificPlace;
}
public String getSpecificPlace() {
return specificPlace;
}
public String getInformation() {
return city.getName() + " " + house.getName() + " " + specificPlace;
}
}