Class Terminal


  • public final class Terminal
    extends java.lang.Object
    The Terminal class : This class defines how terminals are created and how they behave
    • Constructor Summary

      Constructors 
      Constructor Description
      Terminal​(boolean onService, int stationID)
      A (more complex) constructor for the Terminal class
      Terminal​(int stationID)
      A constructor for the Terminal class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dropBicycle​(Bicycle bicycle, User user, Station station)
      This methods implements the dropping but without the time interval, because it gets the computer's time.
      void dropBicycleWithIntervalOfTime​(Bicycle bicycle, User user, Station station, double intervalOfTime)
      This method implements the dropping of a bicycle with an interval of time given by the human.
      boolean isOnService()
      a getter for the onService parameter
      void rentBicycle​(Bicycle bicycle, User user, Station station)
      The rentBicycle method that implements the renting algorithm for the application
      void setOnService​(boolean onService)
      setter for the onService parameter
      • Methods inherited from class java.lang.Object

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

      • Terminal

        public Terminal​(int stationID)
        A constructor for the Terminal class
        Parameters:
        stationID - the station id that will have this terminal
      • Terminal

        public Terminal​(boolean onService,
                        int stationID)
        A (more complex) constructor for the Terminal class
        Parameters:
        onService - a boolean to set the initial state of the terminal
        stationID - the station id that will have this terminal
    • Method Detail

      • isOnService

        public boolean isOnService()
        a getter for the onService parameter
        Returns:
        onService boolean to see if the station is active or not
      • setOnService

        public void setOnService​(boolean onService)
        setter for the onService parameter
        Parameters:
        onService - a boolean to be used when setting the terminal's state
      • rentBicycle

        public void rentBicycle​(Bicycle bicycle,
                                User user,
                                Station station)
        The rentBicycle method that implements the renting algorithm for the application
        Parameters:
        bicycle - a bicycle object (either electrical, or mechanical) that is the type that the user wants
        user - the user object that ask for the renting
        station - the station that is used to the renting
      • dropBicycleWithIntervalOfTime

        public void dropBicycleWithIntervalOfTime​(Bicycle bicycle,
                                                  User user,
                                                  Station station,
                                                  double intervalOfTime)
        This method implements the dropping of a bicycle with an interval of time given by the human. It will increment the parameters in the classes that are involved during the dropping process
        Parameters:
        bicycle - the bicycle that is being dropped
        user - the user that is dropping
        station - the (end) station, that is to say, the station that the user is dropping the bicycle
        intervalOfTime - the interval of time of the location (in minutes)
      • dropBicycle

        public void dropBicycle​(Bicycle bicycle,
                                User user,
                                Station station)
        This methods implements the dropping but without the time interval, because it gets the computer's time.
        Parameters:
        bicycle - The bicycle that is being dropped
        user - The user that is dropping
        station - The station that is receiving the bicycle