HERE Android SDK Developer's Guide

RoutePlan

The class RoutePlan is a member of com.here.android.mpa.routing .

Class Summary

public final class RoutePlan

extends java.lang.Object

RoutePlan contains all information needed to calculate a Route.

[For complete information, see the section Class Details]

See also:

RouteWaypoint

Router

Constructor Summary

Table 1. Constructors in RoutePlan
Constructors

RoutePlan ()

Public Constructor

RoutePlan (RoutePlan other)

Copy Constructor

Method Summary

Table 2. Methods in RoutePlan
Methods

public RoutePlan addWaypoint (RouteWaypoint point)

Adds a waypoint to the plan.

public boolean equals (Object obj)

public RouteOptions getRouteOptions ()

Gets a copy of the current route options used with this RoutePlan .

public RouteWaypoint getWaypoint (int index)

Gets a waypoint at a specified index.

public int getWaypointCount ()

Gets the number of waypoints of the route plan.

public int hashCode ()

public RoutePlan insertWaypoint (RouteWaypoint point, int index)

Inserts a waypoint into a list of existing waypoints.

public RoutePlan removeAllWaypoints ()

Removes all waypoints of the route plan.

public RoutePlan removeWaypoint (int index)

Removes a waypoint at a specified index.

public RoutePlan setRouteOptions (RouteOptions options)

Sets the route options.

Class Details

RoutePlan contains all information needed to calculate a Route. It can carry up to 128 waypoints, each of which is represented by a RouteWaypoint.

However, the first and last waypoints used for route calculation must be of RouteWaypoint.Type.STOP_WAYPOINT type, otherwise, the error INVALID_PARAMETERS will be returned.

See also:

RouteWaypoint

Router

Constructor Details

RoutePlan ()

Public Constructor

RoutePlan (RoutePlan other)

Copy Constructor

Parameters:

  • other

Method Details

public RoutePlan addWaypoint (RouteWaypoint point)

Adds a waypoint to the plan. A maximum of 128 waypoints is allowed for a route.

The first and last waypoints used for route calculation must be of RouteWaypoint.Type.STOP_WAYPOINT type.

NOTE: Urban Mobility supports only 2 waypoints. If UMRouter is used, then adding more than 2 waypoints will result in getting an estimated Public Transport routes.

Parameters:

  • point

    The RouteWaypoint representing the waypoint to add.

Returns:

This RoutePlan object

public boolean equals (Object obj)

Parameters:

  • obj

public RouteOptions getRouteOptions ()

Gets a copy of the current route options used with this RoutePlan . Any changes made to the RouteOptions object returned by this method must be used to call setRouteOptions(RouteOptions) again for the changes to be in effect.

Returns:

RouteOptions options associated with this plan.

public RouteWaypoint getWaypoint (int index)

Gets a waypoint at a specified index.

Parameters:

  • index

    The zero-based index.

Returns:

the waypoint, null if the index submitted is out of bounds.

public int getWaypointCount ()

Gets the number of waypoints of the route plan.

Returns:

the number of waypoints.

public int hashCode ()

public RoutePlan insertWaypoint (RouteWaypoint point, int index)

Inserts a waypoint into a list of existing waypoints. The position of the new waypoint is according to the specified index. A maximum of 128 waypoints is allowed for a route.

The first and last waypoints used for route calculation must be of RouteWaypoint.Type.STOP_WAYPOINT type.

NOTE: Urban Mobility supports only 2 waypoints. If UMRouter is used, then adding more than 2 waypoints will result in getting an estimated Public Transport routes.

Parameters:

  • point

    The waypoint to insert

  • index

    The index in the range from 0 to the number of already existing waypoints.

Returns:

This RoutePlan object

public RoutePlan removeAllWaypoints ()

Removes all waypoints of the route plan.

Returns:

This RoutePlan object

public RoutePlan removeWaypoint (int index)

Removes a waypoint at a specified index.

The first and last waypoints used for route calculation must of be RouteWaypoint.Type.STOP_WAYPOINT type.

Parameters:

  • index

    The zero-based index.

Returns:

This RoutePlan object

public RoutePlan setRouteOptions (RouteOptions options)

Sets the route options. This method does not retain a reference to options . If the options object is updated, then this method must be called again for the changes to be in effect.

Parameters: