package prototype;
import abstractFactory.Bus;
import abstractFactory.Car;
import abstractFactory.FleetFactory;
import abstractFactory.Truck;
public class PrototypeFleetFactory extends FleetFactory {
private Car car;
private Bus bus;
private Truck truck;
public PrototypeFleetFactory(Car car, Bus bus, Truck truck) {
super();
this.car = car;
this.bus = bus;
this.truck = truck;
}
public Bus MakeBus
(String number
) { Bus copy = (Bus) bus.clone();
copy.setNumber(number);
return copy;
}
public Car MakeCar
(String number
) { Car copy = (Car) car.clone();
copy.setNumber(number);
return copy;
}
public Truck MakeTruck
(String number
) { Truck copy = (Truck) truck.clone();
copy.setNumber(number);
return copy;
}
}