Java SDK for 2D
 All Classes Namespaces Functions Variables Pages
ApiItinerary Class Reference

Static Public Member Functions

static void addItinerary (ArrayList< StopOffPoint > pointArr, String itineraryName, int maxTime) throws GeneralException
 Creates itinerary and fills it with the items from PointArr. More...
 
static void setRoute (String itineraryName, int flags, int maxTime) throws NavigationException
 Computes route based on the given itinerary, and if the navigation has a valid GPS signal it starts navigation. More...
 
static void setRoute (String itineraryName, int flags, boolean closedDelivery, int maxTime) throws NavigationException
 
static void addEntryToItinerary (String itineraryName, StopOffPoint stopOffPoint, int index, int maxTime) throws GeneralException
 Adds new waypoint to the given itinerary. More...
 
static void deleteEntryInItinerary (String itineraryName, int index, int maxTime) throws GeneralException
 Deletes the waypoint from itinerary at the given position. More...
 
static void deleteItinerary (String itineraryName, int maxTime) throws GeneralException
 Deletes the given itinerary. More...
 
static ArrayList< StopOffPointgetItineraryList (String itineraryName, int maxTime) throws GeneralException
 Returns the list of waypoints of the itinerary. More...
 
static void skipNextWaypoint (int maxTime) throws GeneralException
 Skips the next waypoint. More...
 

Member Function Documentation

static void addEntryToItinerary ( String  itineraryName,
StopOffPoint  stopOffPoint,
int  index,
int  maxTime 
) throws GeneralException
static

Adds new waypoint to the given itinerary.

Parameters
itineraryNameName of itinerary where new item will be added.
stopOffPointmodel.StopOffPoint instance which contains information about waypoint to be added to itinerary.
indexIndex of position where new waypoint will be inserted.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), Api.getService(), and StopOffPoint.writeBundle().

static void addItinerary ( ArrayList< StopOffPoint pointArr,
String  itineraryName,
int  maxTime 
) throws GeneralException
static

Creates itinerary and fills it with the items from PointArr.

Parameters
pointArrArrayList of model.StopOffPoint items which will be inserted into itinerary.
itineraryNameItinerary name.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), Api.getService(), and StopOffPoint.writeBundle().

static void deleteEntryInItinerary ( String  itineraryName,
int  index,
int  maxTime 
) throws GeneralException
static

Deletes the waypoint from itinerary at the given position.

Parameters
itineraryNameName of itinerary where item will be deleted.
indexIndex in itinerary list which defines which waypoint will be deleted.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

static void deleteItinerary ( String  itineraryName,
int  maxTime 
) throws GeneralException
static

Deletes the given itinerary.

Parameters
itineraryNameName of itinerary to delete.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

static ArrayList<StopOffPoint> getItineraryList ( String  itineraryName,
int  maxTime 
) throws GeneralException
static

Returns the list of waypoints of the itinerary.

Parameters
itineraryName>Name of itinerary from which waypoints will be retrieved. If the name of itinerary is "default", function returns the list of waypoints from current route.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
ArrayList of model.StopOffPoint items which will contain waypoints of itinerary after function execution.
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), Api.getService(), and StopOffPoint.readBundle().

static void setRoute ( String  itineraryName,
int  flags,
int  maxTime 
) throws NavigationException
static

Computes route based on the given itinerary, and if the navigation has a valid GPS signal it starts navigation.

Parameters
itineraryNameName of the itinerary which will be used to compute route.
flagsParameter flags determines route computing properties.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited. Notes:
If Navigation does not have a valid GPS signal, first waypoint in itinerary must be marked as START.
Parameter flags determines some route computing properties. Possible values are enumerated in ApiNavigation class. For example it is possible to ask user to avoid toll roads or (later) notify user that not all toll roads can be avoided.
To join more flags together use logical or operator (|).
Itinerary used to compute route must contain item of type "finish". If you do not have valid GPS position itinerary must contain also item of type "start".

Example:

String strItineraryName = "MyItin";
int nflags = NavigationParams.NpMessageAvoidTollRoadsUnable;
int maxTime = 10000;
ApiItinerary.setRoute(strItineraryName, nflags, maxTime);
       This code starts computing route according to itinerary
       MyItin. If computed route contains toll roads, Navigation asks
       user to avoid them. If toll roads can not be avoided,
       Navigation notify user about this.
Exceptions
exception.NavigationExceptionthe navigation exception

References Api.getInstance(), and Api.getService().

static void setRoute ( String  itineraryName,
int  flags,
boolean  closedDelivery,
int  maxTime 
) throws NavigationException
static
static void skipNextWaypoint ( int  maxTime) throws GeneralException
static

Skips the next waypoint.

Parameters
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().