类 RouteLeg
java.lang.Object
ai.nextbillion.kits.directions.models.DirectionsJsonObject
ai.nextbillion.kits.directions.models.RouteLeg
- 所有已实现的接口:
Serializable
A route between only two
DirectionsWaypoint.- 另请参阅:
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明admins()An array of objects describing the administrative boundaries the route leg travels through.abstract LegAnnotationALegAnnotationthat contains additional details about each line segment along the route geometry.static RouteLeg.Builderbuilder()Create a new instance of this class by using theRouteLeg.Builderclass.closures()A list of closures that occur on this leg.abstract Doubledistance()The distance traveled from one waypoint to another.abstract Doubleduration()The estimated travel time from one waypoint to another.abstract DoubleThe typical travel time for traversing this RouteLeg.static RouteLegCreate a new instance of this class by passing in a formatted valid JSON String.A list of incidents that occur on this leg.steps()Gives a List including all the steps to get from one waypoint to another.abstract Stringsummary()A short human-readable summary of major roads traversed.abstract RouteLeg.BuilderConvert the currentRouteLegto its builder holding the currently assigned values.static com.google.gson.TypeAdapter<RouteLeg>typeAdapter(com.google.gson.Gson gson) Gson type adapter for parsing Gson to this class.从类继承的方法 ai.nextbillion.kits.directions.models.DirectionsJsonObject
toJson
-
构造器详细资料
-
RouteLeg
public RouteLeg()
-
-
方法详细资料
-
builder
Create a new instance of this class by using theRouteLeg.Builderclass.- 返回:
- this classes
RouteLeg.Builderfor creating a new instance
-
distance
The distance traveled from one waypoint to another.- 返回:
- a double number with unit meters
-
duration
The estimated travel time from one waypoint to another.- 返回:
- a double number with unit seconds
-
durationTypical
The typical travel time for traversing this RouteLeg. There's a delay along the RouteLeg if you subtract this durationTypical() value from the RouteLeg duration() value and the resulting difference is greater than 0. The delay is because of any number of real-world situations (road repair, traffic jam, etc).- 返回:
- a double number with unit seconds
-
summary
A short human-readable summary of major roads traversed. Useful to distinguish alternatives.- 返回:
- String with summary
-
admins
An array of objects describing the administrative boundaries the route leg travels through. UseStepIntersection.adminIndex()on the intersection object to look up the admin for each intersection in this array. -
steps
Gives a List including all the steps to get from one waypoint to another.- 返回:
- List of
LegStep
-
incidents
A list of incidents that occur on this leg.- 返回:
- a list of
Incident
-
annotation
ALegAnnotationthat contains additional details about each line segment along the route geometry. If you'd like to receiving this, you must request it inside your Directions request before executing the call.- 返回:
- a
LegAnnotationobject
-
closures
A list of closures that occur on this leg.- 返回:
- a list of
Incident
-
toBuilder
Convert the currentRouteLegto its builder holding the currently assigned values. This allows you to modify a single property and then rebuild the object resulting in an updated and modifiedRouteLeg.- 返回:
- a
RouteLeg.Builderwith the same values set to match the ones defined in thisRouteLeg
-
typeAdapter
Gson type adapter for parsing Gson to this class.- 参数:
gson- the builtGsonobject- 返回:
- the type adapter for this class
-
fromJson
Create a new instance of this class by passing in a formatted valid JSON String.- 参数:
json- a formatted valid JSON string defining a RouteLeg- 返回:
- a new instance of this class defined by the values passed inside this static factory method
-