Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.spatial.router
Class RoutingSettings

java.lang.Object
  extended byoracle.panama.spatial.router.RoutingSettings


public class RoutingSettings
extends java.lang.Object

This class defines routing settings that can be passed to a router. Example are "ShortestDistance" or "AvoidToll." They are two types of options: basic options and secondary options. Basic options are:
- requestMap : whether maps are requested for the route - requestGeometry: whether geometry (shape points) along the route is requested User can specify basic options when constructing a RoutingOption object. The default basic options are request map and do not request geometry points.

Secondary options include:
- RoutingOption.avoidFerry
- RoutingOption.avoidLimitedAccessHwy
- RoutingOption.avoidToll
- RoutingOption.maneuverMapHeigh
- RoutingOption.maneuverMapWidth
- RoutingOption.maneuverMapScale
- RoutingOption.maneuverMapZoomLevel
- RoutingOption.overviewMapHeigh
- RoutingOption.overviewMapWidth
- RoutingOption.overviewMapScale
- RoutingOption.overviewMapZoomLevel
- RoutingOption.optimization (how is the route optimized, currently support "ShortestDistance" and "ShortestTime")

A secondary option can be either required or not required. If a secondary option is required but not available from the provider, it will automtically fail over to the next provider. If a secondary option is not required, then the "best effort" will be attempted.
Therefore, if a secondary option is set to "required" and a non-null result is returned, the option is guaranteed to be satisfied. If a secondary option is not set to "required" then the result may or may not satisfy that option.
The application developers are not required to specify whether a secondary option is required or not. There are a set of default values for secondary options. They are:
AvoidFerry -- Not required
AvoidLimitedAccessHwy -- Not required
AvoidToll -- Not required
overview Map size -- Required
maneuver Map size -- Required
Overview Map scale and zoomlevel -- Not required
Maneuver Map scale and zoomlevel -- Not required
Optimization method -- Not required

This class is not made thread-safe. The API user has to make sure that no other thread is making changes to a RoutingSettings object until it has been used as input for the/all of the routing operation(s).


Field Summary
static java.lang.String SHORTEST_DISTANCE
Constant used to indicate route optimization by shortest distance
static java.lang.String SHORTEST_TIME
Constant used to indicate route optimization by shortest time

Constructor Summary
RoutingSettings()
Default constructor.
RoutingSettings(boolean requestMap, boolean requestGeometry)
Constructor

Method Summary
java.lang.String getSecondaryOption(RoutingOption option)
This returns a secondary routing option.
boolean isGeometryRequested()
This returns whether shape points (lat/lon) are requested.
boolean isMapRequested()
This returns whether maps are requested.
boolean isSecondaryOptionRequired(RoutingOption option)
Returns true if the given option is mandatory
void setBasicOptions(boolean requestMap, boolean requestGeometry)
This sets the basic routing options.
void setRequestGeometry(boolean requestGeometry)
Basic options can also be set separatly.
void setRequestMap(boolean requestMap)
Basic options can also be set separatly.
void setSecondaryOption(RoutingOption option, java.lang.String value)
This sets a secondary routing option.
void setSecondaryOptionRequired(RoutingOption option, boolean required)
Constant used to indicate route optimization by shortest time

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SHORTEST_DISTANCE

public static final java.lang.String SHORTEST_DISTANCE
Constant used to indicate route optimization by shortest distance
See Also:
Constant Field Values

SHORTEST_TIME

public static final java.lang.String SHORTEST_TIME
Constant used to indicate route optimization by shortest time
See Also:
Constant Field Values

Constructor Detail

RoutingSettings

public RoutingSettings()
Default constructor. The default routing options are request map and do not request geometry points.

RoutingSettings

public RoutingSettings(boolean requestMap,
                       boolean requestGeometry)
Constructor
Parameters:
requestMap - a boolean representing whether a map is requested
requestGeometry - a boolean representing whether a list of points (lat/lon) is requested

Method Detail

getSecondaryOption

public java.lang.String getSecondaryOption(RoutingOption option)
This returns a secondary routing option. Secondary options currently include: AvoidFerry, AvoidToll, AvoidLimitedAccessHwy OverviewMapHeight, OverviewMapWidth, OverviewMapZoomLevel, OverviewMapScale ManeuverMapHeight, ManeuverMapWidth, ManeuverMapZoomLevel, ManeuverMapScale
Parameters:
option - a Class representing the option type (in contrast to a String this can be checked for consistency at compile time)
Returns:
a String representing the option value

isGeometryRequested

public boolean isGeometryRequested()
This returns whether shape points (lat/lon) are requested.
Returns:
a boolean representing whether shape points (lat/lon) are requested

isMapRequested

public boolean isMapRequested()
This returns whether maps are requested.
Returns:
a boolean representing whether a map is requested

isSecondaryOptionRequired

public boolean isSecondaryOptionRequired(RoutingOption option)
Returns true if the given option is mandatory
Parameters:
option - the routing option in question
Returns:
true if the given option is required

setBasicOptions

public void setBasicOptions(boolean requestMap,
                            boolean requestGeometry)
This sets the basic routing options.
Parameters:
requestMap - a boolean representing whether maps are requested
requestGeometry - a boolean representing whether a list of points (lat/lon) is requested

setRequestGeometry

public void setRequestGeometry(boolean requestGeometry)
Basic options can also be set separatly. This function sets a basic option.
Parameters:
requestGeometry - a boolean representing whether a list of points (lat/lon) is requested

setRequestMap

public void setRequestMap(boolean requestMap)
Basic options can also be set separatly. This function sets a basic option.
Parameters:
requestMap - a boolean representing whether maps are requested

setSecondaryOption

public void setSecondaryOption(RoutingOption option,
                               java.lang.String value)
This sets a secondary routing option. Secondary options currently include: AvoidFerry, AvoidToll, AvoidLimitedAccessHwy MapHeight, MapWidth, MapZoomLevel, MapScale
Parameters:
option - a Class representing the option type (in contrast to a String this can be checked for consistency at compile time)
value - a String representing the option value

setSecondaryOptionRequired

public void setSecondaryOptionRequired(RoutingOption option,
                                       boolean required)
Constant used to indicate route optimization by shortest time
Parameters:
option - the routing option
required - a boolean to indicate if it is required

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.