HERE Android SDK Developer's Guide

RouteOptions

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

Class Summary

public final class RouteOptions

extends java.lang.Object

This is the definition of the RouteOptions class.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in RouteOptions
Nested Classes

public static final enumeration RouteOptions.TimeType

Ways that the time can be specified.

public static final enumeration RouteOptions.TransportMode

Represents values describing different mode of transportation a person will be using.

public static final enumeration RouteOptions.Type

Represents different types of routing, such as by speed or by distance.

Constructor Summary

Table 2. Constructors in RouteOptions
Constructors

RouteOptions ()

Public Constructor

Method Summary

Table 3. Methods in RouteOptions
Methods

public boolean areCarShuttleTrainsAllowed ()

Checks whether Car Shuttle Trains are allowed.

public boolean areDirtRoadsAllowed ()

Checks whether Dirt Roads are allowed.

public boolean areFerriesAllowed ()

Checks whether Ferries are allowed.

public boolean areHighwaysAllowed ()

Checks whether Highways are allowed.

public boolean areParksAllowed ()

Checks whether Parks are allowed.

public boolean areTollRoadsAllowed ()

Checks whether Toll Roads are allowed.

public boolean areTunnelsAllowed ()

Checks whether Tunnels are allowed.

public int getRouteCount ()

Gets the current desired number of route

public Type getRouteType ()

Gets the Route Type, see RouteOptions.Type for valid values

public int getStartDirection ()

Returns the start direction.

public TimeType getTime (Date date)

Gets the arrival or departure time that has been set.

public TransportMode getTransportMode ()

Gets the Transport Mode, see RouteOptions.TransportMode for valid values

public boolean isCarpoolAllowed ()

Check if usage of HOV/Carpool roads is allowed.

public RouteOptions setCarShuttleTrainsAllowed (boolean value)

Sets whether Car Shuttle Trains are allowed.

public RouteOptions setCarpoolAllowed (boolean value)

Allow or disallow usage of HOV/Carpool roads.

public RouteOptions setDirtRoadsAllowed (boolean value)

Sets whether Dirt Roads are allowed.

public RouteOptions setFerriesAllowed (boolean value)

Sets whether Ferries are allowed.

public RouteOptions setHighwaysAllowed (boolean value)

Sets whether Highways are allowed.

public RouteOptions setParksAllowed (boolean value)

Sets whether Parks are allowed.

public RouteOptions setRouteCount (int count)

Sets the desired number of route.

public RouteOptions setRouteType (Type routeType)

Sets the Route Type, see RouteOptions.Type for valid values

public RouteOptions setStartDirection (int dirInDegrees)

Start direction.

public RouteOptions setTime (Date time, TimeType type)

Sets the arrival or departure time.

public RouteOptions setTollRoadsAllowed (boolean value)

Sets whether Toll Roads are allowed.

public RouteOptions setTransportMode (TransportMode mode)

Sets the Transport Mode.

public RouteOptions setTunnelsAllowed (boolean value)

Sets whether Tunnels are allowed.

Class Details

This is the definition of the RouteOptions class. The class contains options for route calculation.

Constructor Details

RouteOptions ()

Public Constructor

Method Details

public boolean areCarShuttleTrainsAllowed ()

Checks whether Car Shuttle Trains are allowed.

Returns:

true if allowed otherwise false.

public boolean areDirtRoadsAllowed ()

Checks whether Dirt Roads are allowed.

Returns:

true if allowed otherwise false.

public boolean areFerriesAllowed ()

Checks whether Ferries are allowed.

Returns:

true if allowed otherwise false.

public boolean areHighwaysAllowed ()

Checks whether Highways are allowed.

Returns:

true if allowed otherwise false.

public boolean areParksAllowed ()

Checks whether Parks are allowed.

Returns:

true if allowed otherwise false.

public boolean areTollRoadsAllowed ()

Checks whether Toll Roads are allowed.

Returns:

true if allowed otherwise false.

public boolean areTunnelsAllowed ()

Checks whether Tunnels are allowed.

Returns:

true if allowed otherwise false.

public int getRouteCount ()

Gets the current desired number of route

Returns:

current desired number of route

public Type getRouteType ()

Gets the Route Type, see RouteOptions.Type for valid values

Returns:

The current Type.

public int getStartDirection ()

Returns the start direction.

Returns:

The start direction in degrees. Value is between 0-359.

public TimeType getTime (Date date)

Gets the arrival or departure time that has been set.

Parameters:

  • date

    Output parameter where the date will be set. This may be null if the caller is only interested in the RouteOptions.TimeType.

Returns:

The TimeType of the parameter upon completion.

public TransportMode getTransportMode ()

Gets the Transport Mode, see RouteOptions.TransportMode for valid values

Returns:

The {code TransportMode} to be used for this RouteOptions.

public boolean isCarpoolAllowed ()

Check if usage of HOV/Carpool roads is allowed.

Returns:

true if allowed, otherwise false.

public RouteOptions setCarShuttleTrainsAllowed (boolean value)

Sets whether Car Shuttle Trains are allowed.

Parameters:

  • value

    true if allowed otherwise false.

Returns:

The modified RouteOptions itself.

public RouteOptions setCarpoolAllowed (boolean value)

Allow or disallow usage of HOV/Carpool roads.

Parameters:

  • value

    Use true if allowed, otherwise false.

Returns:

The modified RouteOptions itself.

public RouteOptions setDirtRoadsAllowed (boolean value)

Sets whether Dirt Roads are allowed.

Parameters:

  • value

    true if allowed otherwise false.

Returns:

The modified RouteOptions itself.

public RouteOptions setFerriesAllowed (boolean value)

Sets whether Ferries are allowed.

Parameters:

  • value

    true if allowed otherwise false.

Returns:

The modified RouteOptions itself.

public RouteOptions setHighwaysAllowed (boolean value)

Sets whether Highways are allowed.

Parameters:

  • value

    true if allowed otherwise false.

Returns:

The modified RouteOptions itself.

public RouteOptions setParksAllowed (boolean value)

Sets whether Parks are allowed.

Parameters:

  • value

    Use true if allowed, otherwise false.

Returns:

The modified RouteOptions itself.

public RouteOptions setRouteCount (int count)

Sets the desired number of route.

Values greater than 10 are ignored if RouteOptions.TransportMode is set to public transport and online timetables are enabled.

Parameters:

  • count

    route count

Returns:

The modified RouteOptions itself.

public RouteOptions setRouteType (Type routeType)

Sets the Route Type, see RouteOptions.Type for valid values

Parameters:

  • routeType

    Type

Returns:

The modified RouteOptions itself.

public RouteOptions setStartDirection (int dirInDegrees)

Start direction. The direction routing should start. Used for example not to route against one way streets. The direction is disregarded, if RouteOptions.TransportMode is pedestrian. Use values between 0-359. If greater value than 359 is specified, modulo of 360 is used.

Parameters:

  • dirInDegrees

    Start direction in degrees. 0 is north, increases clockwise (ie. 90 is east).

Returns:

The modified RouteOptions itself.

public RouteOptions setTime (Date time, TimeType type)

Sets the arrival or departure time.

Parameters:

  • time

    The time to set.

  • type

    The type of time to set.

Returns:

The modified RouteOptions itself.

Throws:

  • IllegalArgumentException

    If type is set to ARRIVAL, because it is not supported.

public RouteOptions setTollRoadsAllowed (boolean value)

Sets whether Toll Roads are allowed.

Parameters:

  • value

    true if allowed otherwise false.

Returns:

The modified RouteOptions itself.

public RouteOptions setTransportMode (TransportMode mode)

Sets the Transport Mode.

Parameters:

Returns:

The modified RouteOptions itself.

public RouteOptions setTunnelsAllowed (boolean value)

Sets whether Tunnels are allowed.

Parameters:

  • value

    true if allowed otherwise false.

Returns:

The modified RouteOptions itself.