Class StationFactory


  • public class StationFactory
    extends java.lang.Object
    The StationFactory class : This is the factory to create and add new station to a give system. It can add plus or standard stations. It is uses the simple factory design pattern
    • Constructor Summary

      Constructors 
      Constructor Description
      StationFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Station addPlusStation​(MyVelibSystem system, java.awt.Point coordinate, boolean onService, java.util.List<ParkingSlot> parkingSlots)
      This method creates a plus station and add it to a given system with fewer arguments.
      static Station addPlusStation​(MyVelibSystem system, java.awt.Point coordinate, boolean onService, java.util.List<ParkingSlot> parkingSlots, double money, int numberOfDroppings)
      This method creates a plus station and add it to a given system.
      static Station addStandardStation​(MyVelibSystem system, java.awt.Point coordinate, boolean onService, java.util.List<ParkingSlot> parkingSlots)
      This method creates a standard station and add it to a given system with fewer arguments.
      static Station addStandardStation​(MyVelibSystem system, java.awt.Point coordinate, boolean onService, java.util.List<ParkingSlot> parkingSlots, double money, int numberOfDroppings)
      This method creates a standard station and add it to a given system.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StationFactory

        public StationFactory()
    • Method Detail

      • addPlusStation

        public static Station addPlusStation​(MyVelibSystem system,
                                             java.awt.Point coordinate,
                                             boolean onService,
                                             java.util.List<ParkingSlot> parkingSlots,
                                             double money,
                                             int numberOfDroppings)
        This method creates a plus station and add it to a given system.
        Parameters:
        system - the system that will have the new station
        coordinate - the coordinate of the station
        onService - the onService boolean
        parkingSlots - a list of parking slots
        money - the initial money of the station
        numberOfDroppings - the (initial) number of droppings
        Returns:
        the PlusStation instance
      • addPlusStation

        public static Station addPlusStation​(MyVelibSystem system,
                                             java.awt.Point coordinate,
                                             boolean onService,
                                             java.util.List<ParkingSlot> parkingSlots)
        This method creates a plus station and add it to a given system with fewer arguments. It can be simpler in some cases.
        Parameters:
        system - the system that will have the new station
        coordinate - the coordinate of the station
        onService - the onService boolean
        parkingSlots - a list of parking slots
        Returns:
        the PlusStation instance
      • addStandardStation

        public static Station addStandardStation​(MyVelibSystem system,
                                                 java.awt.Point coordinate,
                                                 boolean onService,
                                                 java.util.List<ParkingSlot> parkingSlots,
                                                 double money,
                                                 int numberOfDroppings)
        This method creates a standard station and add it to a given system.
        Parameters:
        system - the system that will have the new station
        coordinate - the coordinate of the station
        onService - the onService boolean
        parkingSlots - a list of parking slots
        money - the initial money of the station
        numberOfDroppings - the (initial) number of droppings
        Returns:
        the StandardStation instance
      • addStandardStation

        public static Station addStandardStation​(MyVelibSystem system,
                                                 java.awt.Point coordinate,
                                                 boolean onService,
                                                 java.util.List<ParkingSlot> parkingSlots)
        This method creates a standard station and add it to a given system with fewer arguments. It can be simpler in some cases.
        Parameters:
        system - the system that will have the new station
        coordinate - the coordinate of the station
        onService - the onService boolean
        parkingSlots - a list of parking slots
        Returns:
        the StandardStation instance