Package core.statistics.balance.user
Class UserApp
- java.lang.Object
-
- core.statistics.balance.user.UserApp
-
public class UserApp extends java.lang.ObjectThe Main class in statistics.balance.user : This class has all the algorithms and methods that we need to calculate the statistics in the application for users, that is to say, standard users or managers.
-
-
Constructor Summary
Constructors Constructor Description UserApp()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetNumberOfRides(User user)Getter for the number of rides (or rentings).static doublegetTimeCreditEarned(User user)Getter for the time credit earned by a user.static doublegetTimeSpentOnBicycle(User user, Bicycle bicycle)Getter for the time spend on bicycle type (Electrical, Mechanical, or other future types due to the Design Patterns used)static doublegetTimeSpentOnElectricalBicycle(User user)This method is used to get the time spent on electrical bicycles.static doublegetTimeSpentOnMechanicalBicycle(User user)This method is used to get the time spent on mechanical bicycles.static voiduserBalance(MyVelibSystem system)This method is used to get the informations of users and compute relevant parameters for the users in a give system parameter 1 : average user balance parameter 2 : average of all charged money parameter 3 : user who paid the most in the system
-
-
-
Method Detail
-
getNumberOfRides
public static int getNumberOfRides(User user)
Getter for the number of rides (or rentings). If the user is still with a bicycle, it will show here a message.- Parameters:
user- The user that is being studied- Returns:
- an integer that represents the number of rides (or rentings)
-
getTimeSpentOnBicycle
public static double getTimeSpentOnBicycle(User user, Bicycle bicycle)
Getter for the time spend on bicycle type (Electrical, Mechanical, or other future types due to the Design Patterns used)- Parameters:
user- the userbicycle- an instance of the bicycle type that we need- Returns:
- a double that represents the time spent [in minutes]
-
getTimeCreditEarned
public static double getTimeCreditEarned(User user)
Getter for the time credit earned by a user. It calls the getter in the user class- Parameters:
user- The used that is being studied- Returns:
- The time credit earned by the user in the current time of the application
-
getTimeSpentOnElectricalBicycle
public static double getTimeSpentOnElectricalBicycle(User user)
This method is used to get the time spent on electrical bicycles.- Parameters:
user- the user that is being studied- Returns:
- the time spent on electrical bicycle
-
getTimeSpentOnMechanicalBicycle
public static double getTimeSpentOnMechanicalBicycle(User user)
This method is used to get the time spent on mechanical bicycles.- Parameters:
user- the user that is being studied- Returns:
- the time spent on mechanical bicycle
-
userBalance
public static void userBalance(MyVelibSystem system)
This method is used to get the informations of users and compute relevant parameters for the users in a give system parameter 1 : average user balance parameter 2 : average of all charged money parameter 3 : user who paid the most in the system- Parameters:
system- the system that will be studied
-
-