de.monarchy.guideme.routing
Interface RoutingComponent

All Known Implementing Classes:
NutiteqRouting

public interface RoutingComponent

Simple interface for using external routing services. A class implementing this interface can either be providing routes synchronously or asynchronously. It is not required to implement both ways, in that case, a UnsupportedOperationException is thrown.

Author:
dstuerze

Field Summary
static int ERROR_NO_ROUTE_FOUND
          Error message indicating the service could not find a route
static int ERROR_SERVICE_DOWN
          Error message indicating the routing service is not responding
static int ERROR_UNKNOWN_DESTINATION
          Error message indication the destination point was not found
static int ERROR_UNKNOWN_START
          Error message indicating the starting point was not found
 
Method Summary
 void calculateRoute(RoutingListener l, GeoCoordinate from, GeoCoordinate to)
          Calls the routing service asynchronously to receive a route between two points.
 void calculateRoute(RoutingListener l, GeoCoordinate from, GeoCoordinate to, GeoCoordinate... via)
          Calls the routing service asynchronously to receive a route between two points.
 RoutePoint[] findRoute(GeoCoordinate from, GeoCoordinate to)
          Calls the routing service synchronously to receive a route between two points.
 RoutePoint[] findRoute(GeoCoordinate from, GeoCoordinate to, GeoCoordinate... via)
          Calls the routing service synchronously to receive a route between two points.
 

Field Detail

ERROR_SERVICE_DOWN

static final int ERROR_SERVICE_DOWN
Error message indicating the routing service is not responding

See Also:
Constant Field Values

ERROR_UNKNOWN_START

static final int ERROR_UNKNOWN_START
Error message indicating the starting point was not found

See Also:
Constant Field Values

ERROR_UNKNOWN_DESTINATION

static final int ERROR_UNKNOWN_DESTINATION
Error message indication the destination point was not found

See Also:
Constant Field Values

ERROR_NO_ROUTE_FOUND

static final int ERROR_NO_ROUTE_FOUND
Error message indicating the service could not find a route

See Also:
Constant Field Values
Method Detail

findRoute

RoutePoint[] findRoute(GeoCoordinate from,
                       GeoCoordinate to)
                       throws java.lang.UnsupportedOperationException
Calls the routing service synchronously to receive a route between two points. The calculated route will be returned as an array of RoutePoints. If the service does not support synchronous routing, an UnsupportedOperationException will be thrown.

Parameters:
from - starting point as GeoCoordinate
to - target as GeoCoordinate
Returns:
RoutePoint[] with route points
Throws:
java.lang.UnsupportedOperationException - if a synchronous call is not supported

findRoute

RoutePoint[] findRoute(GeoCoordinate from,
                       GeoCoordinate to,
                       GeoCoordinate... via)
                       throws java.lang.UnsupportedOperationException
Calls the routing service synchronously to receive a route between two points. The calculated route will be returned as an array of RoutePoints. If the service does not support synchronous routing, an UnsupportedOperationException will be thrown.

Parameters:
from - starting point as GeoCoordinate
to - target as GeoCoordinate
via - a (possibly empty) set of vias for the route in correct order
Returns:
RoutePoint[] with route points
Throws:
java.lang.UnsupportedOperationException - if a synchronous call is not supported

calculateRoute

void calculateRoute(RoutingListener l,
                    GeoCoordinate from,
                    GeoCoordinate to)
                    throws java.lang.UnsupportedOperationException
Calls the routing service asynchronously to receive a route between two points. After the route has been calculated, the onRouteCalculated method of the given RoutingListener will be called. If the service does not support asynchronous routing, an UnsupportedOperationException will be thrown.

Parameters:
from - starting point as GeoCoordinate
to - target as GeoCoordinate
l - the listener to be notified
Throws:
java.lang.UnsupportedOperationException - if a asynchronous call is not supported

calculateRoute

void calculateRoute(RoutingListener l,
                    GeoCoordinate from,
                    GeoCoordinate to,
                    GeoCoordinate... via)
                    throws java.lang.UnsupportedOperationException
Calls the routing service asynchronously to receive a route between two points. After the route has been calculated, the onRouteCalculated method of the given RoutingListener will be called. If the service does not support asynchronous routing, an UnsupportedOperationException will be thrown.

Parameters:
l - the listener to be notified
from - starting point as GeoCoordinate
to - target as GeoCoordinate
via - a (possibly empty) set of vias for the route in correct order
Throws:
java.lang.UnsupportedOperationException - if a asynchronous call is not supported