public class TripPoint extends Object implements Parcelable, Cloneable
Trip, including the origin, destination, or any
intermediate way-points on the Trip.
There are two ways to reference a location when creating a TripPoint:
Location from the user's saved locationsGeoPoint with latitude/longitude coordinatesTripPoint can be
retrieved using the LocationsManager if the TripPoint references a
Location.
NOTE: Any name specified during creation will not be modified based on current
language or locale settings. Calling TripPoint.getName() always returns the value which was provided
when creating the TripPoint instance.Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<TripPoint> |
CREATOR
Parcelable creator for this type.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Constructor and Description |
|---|
TripPoint(Location location)
Create a
TripPoint with the specified Location. |
TripPoint(String displayName,
GeoPoint coordinates)
Create a
TripPoint with the specified name, and coordinates. |
TripPoint(String displayName,
GeoPoint coordinates,
int durationMinutes)
Create a
TripPoint with the specified name, coordinates, and duration. |
TripPoint(T location,
int durationMinutes)
Create a
TripPoint with the specified Location, and duration. |
| Modifier and Type | Method and Description |
|---|---|
int |
describeContents() |
boolean |
equals(Object o) |
int |
getDuration()
Get the duration (in minutes) the user will stop at this location.
|
Location |
getLocation()
Get the
Location associated with this TripPoint. |
String |
getName()
Get the name of this location.
|
GeoPoint |
getPoint()
Get the latitude/longitude coordinate of this location as a
GeoPoint. |
TimeZone |
getTimeZone()
Returns the
TimeZone for this TripPoint. |
int |
hashCode() |
boolean |
isDeleted()
Returns true if the
Location used to create this TripPoint has been deleted. |
void |
setDuration(int duration)
Set the duration (in minutes) the user will stop at this location.
|
String |
toString() |
void |
writeToParcel(Parcel dest,
int flags) |
public static final Parcelable.Creator<TripPoint> CREATOR
public TripPoint(String displayName, GeoPoint coordinates, int durationMinutes)
TripPoint with the specified name, coordinates, and duration.displayName - display name of the location, may be nullcoordinates - latitude/longitude coordinates of the location, must not be nulldurationMinutes - duration (in minutes) the user will stop at this locationGeoPointpublic TripPoint(String displayName, GeoPoint coordinates)
TripPoint with the specified name, and coordinates.displayName - display name of the location, may be nullcoordinates - latitude/longitude coordinates of the location, must not be nullGeoPointpublic TripPoint(T location,
int durationMinutes)
TripPoint with the specified Location, and duration.T - the type of locationlocation - location, must not be nulldurationMinutes - duration (in minutes) the user will stop at this locationLocationpublic final int describeContents()
describeContents in interface Parcelablepublic final void writeToParcel(Parcel dest, int flags)
writeToParcel in interface Parcelablepublic Location getLocation()
Location associated with this TripPoint. The return value may be null
if there is no associated Location or if the associated Location is no longer
available.Location if available, null otherwisepublic GeoPoint getPoint()
GeoPoint.GeoPointpublic String getName()
TripPoint was created then this method will
return null. In this case the GeoPoint should be converted into a user-friendly
location to obtain a user-friendly location using a reverse geocode.public int getDuration()
TripPoint is one of the way-points on a Trip and will be ignored if the
TripPoint is the origin or destination.public void setDuration(int duration)
TripPoint is one of the way-points on a Trip and will be ignored if the
TripPoint is the origin or destination.
The duration must also be a non-negative value, and negative values are ignored and the duration
defaults to 0.duration - duration (in minutes)public boolean isDeleted()
Location used to create this TripPoint has been deleted.
If true, this implies that the TripPoint.getLocationId() is no longer valid.true if the associated Location has been deleted, false otherwise
or if the TripPoint was not created from a Locationpublic TimeZone getTimeZone()
TimeZone for this TripPoint. The time zone can be used
to calculate a meaningful arrival/departure time for a Trip given
travel time.
The timezone is only available after the Trip has been saved.TripPoint, or null if the time zone is not availableCopyright © 2013-2016 INRIX, Inc. All Rights Reserved.