public class TimeResponse extends Object
| Constructor and Description |
|---|
TimeResponse(TravelOptions travelOptions,
org.json.JSONObject result,
long requestStart)
Create a response from JSON results.
|
TimeResponse(TravelOptions travelOptions,
String code,
long requestTime,
long requestStart)
Create a response with custom response code and without results.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTravelTime(Coordinate source,
Coordinate target,
Integer travelTime) |
String |
getCode() |
long |
getRequestTimeMillis() |
long |
getTotalTime() |
TravelOptions |
getTravelOptions() |
Integer |
getTravelTime(Coordinate source,
Coordinate target) |
Map<Coordinate,Map<Coordinate,Integer>> |
getTravelTimes()
Get travel times from each source point to each target point.
|
void |
mapResults(org.json.JSONObject result)
Parse results in JSON to travel times map.
|
void |
mapResults(TravelOptions travelOptions,
org.json.JSONObject result)
Parse results in JSON to travel times map.
|
public TimeResponse(TravelOptions travelOptions, org.json.JSONObject result, long requestStart)
travelOptions - Travel options used in requestresult - Travel times in JSONrequestStart - Start time of executionpublic TimeResponse(TravelOptions travelOptions, String code, long requestTime, long requestStart)
travelOptions - Travel options used in requestcode - Response coderequestTime - Execution time in millisecondsrequestStart - Start time of executionpublic void mapResults(org.json.JSONObject result)
result - resulting JSONpublic void mapResults(TravelOptions travelOptions, org.json.JSONObject result)
travelOptions - options used in the requestresult - resulting JSONpublic void addTravelTime(Coordinate source, Coordinate target, Integer travelTime)
source - Source coordinatetarget - Target coordinatetravelTime - Travel time to be addedpublic Integer getTravelTime(Coordinate source, Coordinate target)
source - Source coordinatetarget - Target coordinatepublic String getCode()
public long getRequestTimeMillis()
public TravelOptions getTravelOptions()
public Map<Coordinate,Map<Coordinate,Integer>> getTravelTimes()
public long getTotalTime()
Copyright © 2017. All rights reserved.