de.monarchy.guideme.routing.nutiteq
Class NutiteqRouting

java.lang.Object
  extended by de.monarchy.guideme.routing.nutiteq.NutiteqRouting
All Implemented Interfaces:
RoutingComponent

public class NutiteqRouting
extends java.lang.Object
implements RoutingComponent

Implements a RoutingComponent for the nutiteq maps api. It uses Cloudmade asynchronous routing as routing service.

Author:
dstuerze

Field Summary
 
Fields inherited from interface de.monarchy.guideme.routing.RoutingComponent
ERROR_NO_ROUTE_FOUND, ERROR_SERVICE_DOWN, ERROR_UNKNOWN_DESTINATION, ERROR_UNKNOWN_START
 
Constructor Summary
NutiteqRouting()
           
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NutiteqRouting

public NutiteqRouting()
Method Detail

calculateRoute

public void calculateRoute(RoutingListener l,
                           GeoCoordinate from,
                           GeoCoordinate to)
                    throws java.lang.UnsupportedOperationException
Description copied from interface: RoutingComponent
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.

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

calculateRoute

public void calculateRoute(RoutingListener l,
                           GeoCoordinate from,
                           GeoCoordinate to,
                           GeoCoordinate... via)
                    throws java.lang.UnsupportedOperationException
Description copied from interface: RoutingComponent
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.

Specified by:
calculateRoute in interface RoutingComponent
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 - in every case

findRoute

public RoutePoint[] findRoute(GeoCoordinate from,
                              GeoCoordinate to)
                       throws java.lang.UnsupportedOperationException
Description copied from interface: RoutingComponent
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.

Specified by:
findRoute in interface RoutingComponent
Parameters:
from - starting point as GeoCoordinate
to - target as GeoCoordinate
Returns:
RoutePoint[] with route points
Throws:
java.lang.UnsupportedOperationException - in every case

findRoute

public RoutePoint[] findRoute(GeoCoordinate from,
                              GeoCoordinate to,
                              GeoCoordinate... via)
                       throws java.lang.UnsupportedOperationException
Description copied from interface: RoutingComponent
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.

Specified by:
findRoute in interface RoutingComponent
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 - in every case