com.waldura.tw
Interface RoutesMap

All Known Implementing Classes:
DenseRoutesMap

public interface RoutesMap

This interface defines the object storing the graph of all routes in the system.

Version:
$Id: RoutesMap.java 2367 2007-08-20 21:47:25Z renaud $
Author:
Renaud Waldura <renaud+tw@waldura.com>

Method Summary
 void addDirectRoute(City start, City end, int distance)
          Enter a new segment in the graph.
 java.util.List<City> getDestinations(City city)
          Get the list of cities that can be reached from the given city.
 int getDistance(City start, City end)
          Get the value of a segment.
 RoutesMap getInverse()
           
 java.util.List<City> getPredecessors(City city)
          Get the list of cities that lead to the given city.
 

Method Detail

addDirectRoute

void addDirectRoute(City start,
                    City end,
                    int distance)
Enter a new segment in the graph.


getDistance

int getDistance(City start,
                City end)
Get the value of a segment.


getDestinations

java.util.List<City> getDestinations(City city)
Get the list of cities that can be reached from the given city.


getPredecessors

java.util.List<City> getPredecessors(City city)
Get the list of cities that lead to the given city.


getInverse

RoutesMap getInverse()
Returns:
the transposed graph of this graph, as a new RoutesMap instance.