Skip to content

Ride.java

Raphael Lutz edited this page Aug 19, 2018 · 1 revision

Represents a possible ride for a vehicle.

Fields

  • String roadName : the starting road of the ride.
  • ArrayList<Connection> nextConnections = new ArrayList<Connection>() : an array list of the connections of the ride.

Constructor

  • Ride() : default constructor of the class.
  • Ride(String name) : constructor with a starting road name.
  • void print() : overrides System.out.print() to display the ride in the terminal.
  • void addNextConnection(Connection e) : adds a connection to the ride.
  • void removeLastConnection() : removes the last connection of the ride.
  • Ride clone() : clones the current ride, and returns this clone.

Getters and setters

The getters and setters for roadName and nextConnections.

Clone this wiki locally