Package core.components.factories
Class BicycleFactory
- java.lang.Object
-
- core.components.factories.BicycleFactory
-
public class BicycleFactory extends java.lang.Object
The BicycleFactory class : This is the factory to create and add new bicycles, either electrical or mechanical It is uses the simple factory design pattern
-
-
Constructor Summary
Constructors Constructor Description BicycleFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addElectricalBicycle(MyVelibSystem system, Station station)
This method is responsible for creating an electrical bicycle given a station and a systemstatic void
addMechanicalBicycle(MyVelibSystem system, Station station)
This method is responsible for creating a mechanical bicycle given a station and a systemstatic Bicycle
createElectricalBicycle()
This method is responsible for creating an electrical bicycle (just an instance).static Bicycle
createMechanicalBicycle()
This method is responsible for creating a mechanical bicycle (just an instance).
-
-
-
Method Detail
-
addElectricalBicycle
public static void addElectricalBicycle(MyVelibSystem system, Station station)
This method is responsible for creating an electrical bicycle given a station and a system- Parameters:
system
- the systemstation
- the station
-
createElectricalBicycle
public static Bicycle createElectricalBicycle()
This method is responsible for creating an electrical bicycle (just an instance). It is important in some packages of the project- Returns:
- the new electrical bicycle instance
-
addMechanicalBicycle
public static void addMechanicalBicycle(MyVelibSystem system, Station station)
This method is responsible for creating a mechanical bicycle given a station and a system- Parameters:
system
- the systemstation
- the station
-
createMechanicalBicycle
public static Bicycle createMechanicalBicycle()
This method is responsible for creating a mechanical bicycle (just an instance). It is important in some packages of the project- Returns:
- the new mechanical bicycle instance
-
-