Clean up TrafficPoliceCar and Changed CanBeGovtCar
Signed-off-by: HeshamTB <hishaminv@gmail.com> Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
713e902e05
commit
7c9fd44070
@ -1,3 +1,4 @@
|
|||||||
public interface CanBeGovtCar {
|
public interface CanBeGovtCar {
|
||||||
void generateGovtID();
|
void generateGovtID();
|
||||||
|
String getGovtID();
|
||||||
}
|
}
|
||||||
|
@ -8,30 +8,19 @@ public class TrafficPoliceCar extends Vehicle implements CanBeGovtCar, CanFixAcc
|
|||||||
* construct instance with random GovtID
|
* construct instance with random GovtID
|
||||||
* @param vehicleSize Length of vehicle in meters
|
* @param vehicleSize Length of vehicle in meters
|
||||||
*/
|
*/
|
||||||
public TrafficPoliceCar(double vehicleSize){
|
public TrafficPoliceCar(double vehicleSize) {
|
||||||
super(vehicleSize);
|
super(vehicleSize);
|
||||||
getGovtID();
|
generateGovtID();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct instance with given GovtID
|
|
||||||
* @param vehicleSize Length of vehicle in meters
|
|
||||||
* @param govtID Provided Govt ID
|
|
||||||
*/
|
|
||||||
// public TrafficPoliceCar(double vehicleSize, int govtID) {
|
|
||||||
// super(vehicleSize);
|
|
||||||
// this.govtID = govtID;
|
|
||||||
// } //TODO ãÇ íÍÊÇÌ ÇääÇ ääÔÆ íæ Çí Ïí ÈãÇ Çäå ÇáÇäÔÇÁ Ú ÇáÓÊÇÊß
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generateGovtID(){
|
public void generateGovtID(){
|
||||||
numeberOfTPC++;
|
numeberOfTPC++;
|
||||||
this.TPC_UID = String.format("TPC%03d", numeberOfTPC);
|
this.TPC_UID = String.format("TPC%03d", numeberOfTPC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getGovtID() {
|
public String getGovtID() {
|
||||||
return this.TPC_UID;
|
return this.TPC_UID;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user