Package core.system

Class MyVelibSystem


  • public class MyVelibSystem
    extends java.lang.Object
    The MyVelibSystem class : This class is responsible to implement what a myVelib system (or network) is. It shows how the system will behave, what are its attributes and important methods
    • Constructor Summary

      Constructors 
      Constructor Description
      MyVelibSystem()
      (Simplest) constructor for the system class, will create an (empty) system
      MyVelibSystem​(java.util.List<Station> stations)
      (Simpler) constructor for the system class
      MyVelibSystem​(java.util.List<Station> stations, java.util.List<User> users, double money)
      Constructor for the system class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addMoney​(double money)
      This methods is responsible for adding money in the system
      void displayStationReport​(Station station)
      This method displays a report for a given station in the system
      void displaySystemReport()
      This method displays a report for the system (the system itself)
      void displayUserReport​(User user)
      This method displays a report for a given user in the system
      boolean equals​(java.lang.Object o)
      equals method
      double getMoney()
      Getter for the money parameter
      java.lang.String getName()
      Getter for the name
      java.util.List<Station> getStations()
      Getter for the stations parameter
      java.util.List<User> getUsers()
      Getter for the users parameter
      int hashCode()
      hashCode method
      void removeMoney​(double money)
      This methods is responsible for removing money from the system
      void rentBicycle​(int userID, int StationID)
      This method is responsible to implement a way to rent a bicycle in the system class.
      void setMoney​(double money)
      Setter for money
      void setName​(java.lang.String name)
      Setter for the name of the system
      void setStations​(java.util.List<Station> stations)
      Setter for the stations parameter
      void setUsers​(java.util.List<User> users)
      Setter for users
      java.lang.String toString()
      toString method
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MyVelibSystem

        public MyVelibSystem​(java.util.List<Station> stations,
                             java.util.List<User> users,
                             double money)
        Constructor for the system class
        Parameters:
        stations - a list of stations
        users - a list of users
        money - an amount of money that the system will have
      • MyVelibSystem

        public MyVelibSystem​(java.util.List<Station> stations)
        (Simpler) constructor for the system class
        Parameters:
        stations - a list of stations
      • MyVelibSystem

        public MyVelibSystem()
        (Simplest) constructor for the system class, will create an (empty) system
    • Method Detail

      • getStations

        public java.util.List<Station> getStations()
        Getter for the stations parameter
        Returns:
        stations
      • setStations

        public void setStations​(java.util.List<Station> stations)
        Setter for the stations parameter
        Parameters:
        stations - a list of stations
      • getUsers

        public java.util.List<User> getUsers()
        Getter for the users parameter
        Returns:
        users
      • setUsers

        public void setUsers​(java.util.List<User> users)
        Setter for users
        Parameters:
        users - a list of user objects
      • getMoney

        public double getMoney()
        Getter for the money parameter
        Returns:
        money
      • setMoney

        public void setMoney​(double money)
        Setter for money
        Parameters:
        money - the amount of money that the system will have
      • getName

        public java.lang.String getName()
        Getter for the name
        Returns:
        name of the system
      • setName

        public void setName​(java.lang.String name)
        Setter for the name of the system
        Parameters:
        name - A string that represents the new name of the system
      • toString

        public java.lang.String toString()
        toString method
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string that represents the system
      • equals

        public boolean equals​(java.lang.Object o)
        equals method
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - an object
        Returns:
        true or false
      • hashCode

        public int hashCode()
        hashCode method
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash(stations, users)
      • rentBicycle

        public void rentBicycle​(int userID,
                                int StationID)
        This method is responsible to implement a way to rent a bicycle in the system class. It will ask for the algorithm in the Terminal class
        Parameters:
        userID - the user id
        StationID - the station id
      • addMoney

        public void addMoney​(double money)
        This methods is responsible for adding money in the system
        Parameters:
        money - the amount of money to be added
      • removeMoney

        public void removeMoney​(double money)
        This methods is responsible for removing money from the system
        Parameters:
        money - the amount of money to be removed
      • displayUserReport

        public void displayUserReport​(User user)
        This method displays a report for a given user in the system
        Parameters:
        user - the user that will be studied
      • displayStationReport

        public void displayStationReport​(Station station)
        This method displays a report for a given station in the system
        Parameters:
        station - the station
      • displaySystemReport

        public void displaySystemReport()
        This method displays a report for the system (the system itself)