public final class RouteLeg

  1. Object
  2. RouteLeg
The portion of a Route between two consecutive stops. A direct journey has a single leg; each RouteRequest.addWaypoint adds another.

Constructors

public RouteLeg(String summary, double distanceMeters, double durationSeconds, List steps)Creates a leg.

Methods

public String getSummary()A short description of the leg, typically the major roads it uses.
public double getDistanceMeters()The length of this leg in meters.
public double getDurationSeconds()The estimated travel time for this leg in seconds.
public List getSteps()The unmodifiable list of RouteSteps making up this leg.
public String toString()Returns a string representation of the object.

Inherited methods

Constructor details

RouteLeg

public RouteLeg(String summary, double distanceMeters, double durationSeconds, List steps)
Creates a leg. Called by RouteService implementations.

Parameters

summary String
a short description such as the major roads used
distanceMeters double
the length of the leg in meters
durationSeconds double
the estimated travel time in seconds
steps List
the RouteSteps of this leg, defensively copied

Method details

getSummary

public String getSummary()
A short description of the leg, typically the major roads it uses.

getDistanceMeters

public double getDistanceMeters()
The length of this leg in meters.

getDurationSeconds

public double getDurationSeconds()
The estimated travel time for this leg in seconds.

getSteps

public List getSteps()
The unmodifiable list of RouteSteps making up this leg. Empty when the request had RouteRequest.setSteps turned off.

toString

public String toString()
Returns a string representation of the object. In general, the toString method returns a string that “textually represents” this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@’, and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + ‘@’ + Integer.toHexString(hashCode())