Package core.renting
Class RentingApp
- java.lang.Object
-
- core.renting.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 bicyclestatic double
computeRentTime(User user)
Used to compute the duration of the locationstatic double
getCostWithoutTimeCredit(Bicycle bicycle, Card card, java.sql.Time intervalOfTime)
Used to compute the cost according to some criteriastatic double
getCostWithTimeCredit(Bicycle bicycle, Card card, java.sql.Time intervalOfTime, double timeCredit, User user)
sed to compute the cost according to some criteria
-
-
-
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 rentcard
- : type of card the user is usingintervalOfTime
- : 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 rentcard
- : type of card the user is usingintervalOfTime
- : interval of renting time used to compute the costtimeCredit
- : User's time credituser
- : 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
-
-