Package core.components
Class Terminal
- java.lang.Object
-
- core.components.Terminal
-
public final class Terminal extends java.lang.Object
The Terminal class : This class defines how terminals are created and how they behave
-
-
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 parametervoid
rentBicycle(Bicycle bicycle, User user, Station station)
The rentBicycle method that implements the renting algorithm for the applicationvoid
setOnService(boolean onService)
setter for the onService parameter
-
-
-
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 terminalstationID
- 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 wantsuser
- the user object that ask for the rentingstation
- 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 droppeduser
- the user that is droppingstation
- the (end) station, that is to say, the station that the user is dropping the bicycleintervalOfTime
- 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 droppeduser
- The user that is droppingstation
- The station that is receiving the bicycle
-
-