-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vehicles.java
115 lines (107 loc) · 2.57 KB
/
Vehicles.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
public abstract class Vehicles implements Comparable<Vehicles>,Cloneable{
//Instance variables
String modeName;
String modelNo;
String brand;
String engineType;
double tankSize;
double fuelConsumption;
public Owner owner;
public abstract double costFor100km(PetroleumType type);
public double MovableDistance()
{//capacity fuelConsumption*tankSize
return fuelConsumption*tankSize;
}
public abstract void setAirConditionOn();
public abstract void setAirConditionff();
/**
* @return the modeName
*/
public String getModeName() {
return modeName;
}
/**
* @param modeName the modeName to set
*/
public void setModeName(String modeName) {
this.modeName = modeName;
}
/**
* @return the modelNo
*/
public String getModelNo() {
return modelNo;
}
/**
* @param modelNo the modelNo to set
*/
public void setModelNo(String modelNo) {
this.modelNo = modelNo;
}
/**
* @return the brand
*/
public String getBrand() {
return brand;
}
/**
* @param brand the brand to set
*/
public void setBrand(String brand) {
this.brand = brand;
}
/**
* @return the engineType
*/
public String getEngineType() {
return engineType;
}
/**
* @param engineType the engineType to set
*/
public void setEngineType(String engineType) {
this.engineType = engineType;
}
/**
* @return the tankSize
*/
public double getTankSize() {
return tankSize;
}
/**
* @param tankSize the tankSize to set
*/
public void setTankSize(double tankSize) {
this.tankSize = tankSize;
}
/**
* @return the fuelConsumption
*/
public double getFuelConsumption() {
return fuelConsumption;
}
/**
* @param fuelConsumption the fuelConsumption to set
*/
public void setFuelConsumption(double fuelConsumption) {
this.fuelConsumption = fuelConsumption;
}
/**
* @return the owner
*/
public Owner getOwner() {
return owner;
}
/**
* @param owner the owner to set
*/
public void setOwner(Owner owner) {
this.owner = owner;
}
@Override
public String toString() {
return "Vehicles [modeName=" + modeName + ", modelNo=" + modelNo + ", brand=" + brand + ", engineType="
+ engineType + ", tankSize=" + tankSize + ", fuelConsumption=" + fuelConsumption + ", owner=" + owner
+ "]";
}
}