Package core.renting

Class RentingApp


  • public class RentingApp
    extends java.lang.Object
    The RentingApp class of renting module : This class contains all algorithms that are needed during the renting process. This class is called when a User need to rent a bicycle
    • Constructor Summary

      Constructors 
      Constructor Description
      RentingApp()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void chargingUser​(User user, double priceToBePayed, Station station)
      Charging the user after he dropped the bicycle
      static double computeRentTime​(User user)
      Used to compute the duration of the location
      static double getCostWithoutTimeCredit​(Bicycle bicycle, Card card, java.sql.Time intervalOfTime)
      Used to compute the cost according to some criteria
      static double getCostWithTimeCredit​(Bicycle bicycle, Card card, java.sql.Time intervalOfTime, double timeCredit, User user)
      sed to compute the cost according to some criteria
      • Methods inherited from class java.lang.Object

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

      • RentingApp

        public RentingApp()
    • Method Detail

      • getCostWithoutTimeCredit

        public static double getCostWithoutTimeCredit​(Bicycle bicycle,
                                                      Card card,
                                                      java.sql.Time intervalOfTime)
        Used to compute the cost according to some criteria
        Parameters:
        bicycle - : Type of bicycle the user wants to rent
        card - : type of card the user is using
        intervalOfTime - : interval of renting time used to compute the cost
        Returns:
        cost
      • getCostWithTimeCredit

        public static double getCostWithTimeCredit​(Bicycle bicycle,
                                                   Card card,
                                                   java.sql.Time intervalOfTime,
                                                   double timeCredit,
                                                   User user)
        sed to compute the cost according to some criteria
        Parameters:
        bicycle - : Type of bicycle the user wants to rent
        card - : type of card the user is using
        intervalOfTime - : interval of renting time used to compute the cost
        timeCredit - : User's time credit
        user - : user who wants to rent a bicycle
        Returns:
        cost
      • computeRentTime

        public static double computeRentTime​(User user)
        Used to compute the duration of the location
        Parameters:
        user - a user
        Returns:
        an interval of time used to compute the cost
      • chargingUser

        public static void chargingUser​(User user,
                                        double priceToBePayed,
                                        Station station)
        Charging the user after he dropped the bicycle
        Parameters:
        user - a user
        priceToBePayed - : compute by the cost function
        station - : station where he dropped the bicycle