-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWaterBody.java
More file actions
22 lines (22 loc) · 938 Bytes
/
Copy pathWaterBody.java
File metadata and controls
22 lines (22 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package lab4;
class WaterObject extends Entity {
private TypeOfWaterObject type;
private DescriptionOfWater description;
public WaterObject(TypeOfWaterObject type, Area areaType, String name){
super(type.getType() + " на территории " + areaType.getArea() + " " + name);
this.type = type;
if ((name == "Стокгольм") && (areaType == Area.CITY)) {
description = DescriptionOfWater.FADED;
} else {
description = DescriptionOfWater.ORDINARY;
}
}
public WaterObject(Area areaType, String name){
super(TypeOfWaterObject.BAY.getType() + " на территории " + areaType.getArea() + " " + name);
type = TypeOfWaterObject.BAY;
description = DescriptionOfWater.ORDINARY;
}
public String getInformation() {
return getName() + " (воды данного водоема обладают характеристикой: " + description.getDescription() + ")";
}
}