Class 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 Detail

      • BicycleFactory

        public BicycleFactory()
    • 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 system
        station - 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 system
        station - 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