transport
Class Network

java.lang.Object
  extended by transport.TransportationObject
      extended by transport.Network

public class Network
extends TransportationObject

Public transportation network.


Field Summary
static Network PARIS_RER
          Public transportation network containing a part of Paris' RER A and B.
 
Method Summary
 java.util.List<TripSection> calculateTrip(Station origin, Station destination)
          Calculate a trip (journey) in the transportation network, from a given origin to a given destination.
 java.util.List<Line> getLines()
          Returns the list of lines in the network.
 Station getStationForName(java.lang.String name)
          Returns the station with the given name in the network, if there is such a station, or null otherwise.
 
Methods inherited from class transport.TransportationObject
getName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARIS_RER

public static final Network PARIS_RER
Public transportation network containing a part of Paris' RER A and B.

Method Detail

getLines

public java.util.List<Line> getLines()
Returns the list of lines in the network.

Returns:
the list of lines

calculateTrip

public java.util.List<TripSection> calculateTrip(Station origin,
                                                 Station destination)
Calculate a trip (journey) in the transportation network, from a given origin to a given destination. The method uses Dijkstra's algorithm to find a shortest path.

Parameters:
origin - the origin of the trip
destination - the destination of the trip
Returns:
a list of TripSection objects describing the trip

getStationForName

public Station getStationForName(java.lang.String name)
Returns the station with the given name in the network, if there is such a station, or null otherwise.

Parameters:
name - the name of the station (case-insensitive)
Returns:
the Station object