net.rim.device.api.lbs.travel
Class TravelTime

java.lang.Object
  extended by net.rim.device.api.lbs.travel.TravelTime

public final class TravelTime
extends Object

An instance of this class is returned by the TravelTimeEstimator class to provide the travel time estimate. This class also provides the original values that were used to determine the travel time estimate.

This class provides a default constructor and setter method. These methods can be used to construct a TravelTime object for general purpose use, such as automated testing.

See Also:
TravelTimeEstimator
Since:
BlackBerry API 6.0.0

Field Summary
static long START_NOW
          Indicates that travel will start immediately.
 
Constructor Summary
TravelTime()
          Constructs a TravelTime object for general purpose use, such as automated testing.
TravelTime(TravelTime travelTime)
          Creates a deep copy of the specified TravelTime object.
 
Method Summary
 long getDistance()
          Retrieves the distance along the path of the route from the starting point to the ending point.
 long getElapsedTime()
          Retrieves the estimated travel time between the starting and ending points.
 Coordinates getEnd()
          Retrieves the destination point.
 TravelTimeOptions getOptions()
          Retrieves the options specified when requesting a travel time estimate.
 TravelTimeRequest getRequest()
          Retrieves an object representing the request that produced this estimate.
 Coordinates getStart()
          Retrieves the starting point.
 long getStartTime()
          Retrieves the time at which travel is to start.
 void setDistance(long distance)
          Sets the distance along the path of the route from the starting point to the ending point.
 void setElapsedTime(long elapsedTime)
          Sets the estimated travel time between the starting and ending points.
 void setEnd(Coordinates end)
          Sets the destination point.
 void setOptions(TravelTimeOptions options)
          Sets the options when requesting a travel time estimate.
 void setStart(Coordinates start)
          Sets the starting point.
 void setStartTime(long startTime)
          Sets the time at which travel is to start.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

START_NOW

public static final long START_NOW
Indicates that travel will start immediately.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0


Constructor Detail

TravelTime

public TravelTime()
Constructs a TravelTime object for general purpose use, such as automated testing.

TravelTime objects are normally constructed and returned from a travel time estimate request that was made using the methods in the TravelTimeEstimator class.

Since:
BlackBerry API 6.0.0

TravelTime

public TravelTime(TravelTime travelTime)
Creates a deep copy of the specified TravelTime object.

Parameters:
travelTime - The object to be copied
Since:
BlackBerry API 6.0.0


Method Detail

getRequest

public TravelTimeRequest getRequest()
Retrieves an object representing the request that produced this estimate.

Returns:
An object representing the request that produced this estimate or null if the TravelTime object was not created as a result of a travel time estimate request.
Since:
BlackBerry API 6.0.0

getStart

public Coordinates getStart()
Retrieves the starting point.

Returns:
The starting point.
Since:
BlackBerry API 6.0.0

setStart

public void setStart(Coordinates start)
Sets the starting point.

Parameters:
start - Coordinates representing the starting point.

Note: The Coordinates class is mutable and this method does not make a copy of the object.

Since:
BlackBerry API 6.0.0

getEnd

public Coordinates getEnd()
Retrieves the destination point.

Returns:
The destination point.
Since:
BlackBerry API 6.0.0

setEnd

public void setEnd(Coordinates end)
Sets the destination point.

Parameters:
end - The destination point.

Note: The Coordinates class is mutable and this method does not make a copy of the object.

Since:
BlackBerry API 6.0.0

getStartTime

public long getStartTime()
Retrieves the time at which travel is to start. The travel time estimate is valid only for travel at the specified start time. If TravelTime.START_NOW was specified when you requested the travel time estimate, this method returns the actual time at which the estimate was received from the Travel Time service.

Returns:
The time at which travel is to start. The time is expressed in milliseconds since January 1, 1970 00:00:00 GMT, which corresponds to the value returned by the java.util.Date.getTime() method.
Since:
BlackBerry API 6.0.0

setStartTime

public void setStartTime(long startTime)
Sets the time at which travel is to start.

Parameters:
startTime - The time at which travel is to start. The value is the number of millseconds since January 1, 1970, 00:00:00 GMT, which is the value returned by the java.util.Date.getTime() method. To indicate that travel will start immediately, pass TravelTime.START_NOW.
Since:
BlackBerry API 6.0.0

getOptions

public TravelTimeOptions getOptions()
Retrieves the options specified when requesting a travel time estimate.

Returns:
The estimate request options or null if no options were specified.
Since:
BlackBerry API 6.0.0

setOptions

public void setOptions(TravelTimeOptions options)
Sets the options when requesting a travel time estimate.

Parameters:
options - The estimate request options or null if no options are used.

Note: The TravelTimeOptions class is mutable and this method does not make a copy of the object.

Since:
BlackBerry API 6.0.0

getElapsedTime

public long getElapsedTime()
Retrieves the estimated travel time between the starting and ending points.

Returns:
The estimated number of milliseconds to travel from the starting points to the ending point at the specified start time.
Since:
BlackBerry API 6.0.0

setElapsedTime

public void setElapsedTime(long elapsedTime)
Sets the estimated travel time between the starting and ending points.

Parameters:
elapsedTime - The estimated number of milliseconds to travel from the starting point to the ending point.
Since:
BlackBerry API 6.0.0

getDistance

public long getDistance()
Retrieves the distance along the path of the route from the starting point to the ending point.

Returns:
The distance in meters along the path of the route from the starting point to the ending point.
Since:
BlackBerry API 6.0.0

setDistance

public void setDistance(long distance)
Sets the distance along the path of the route from the starting point to the ending point.

Parameters:
distance - The distance in meters along the path of the route from the starting point to the ending point.
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.