Class PointOfInterestResponse

java.lang.Object
com.targomo.client.api.response.PointOfInterestResponse

public class PointOfInterestResponse extends Object
  • Constructor Details

    • PointOfInterestResponse

      public PointOfInterestResponse(TravelOptions travelOptions, org.json.JSONObject result, boolean resultContainsEdgeWeights, long requestStart)
      Create a response from JSON results, using given travel options
      Parameters:
      travelOptions - travel options, from the request
      result - Travel times in JSON
      resultContainsEdgeWeights - does the result object contain edgeWeight for each POI
      requestStart - Start time of execution
  • Method Details

    • mapResults

      public void mapResults()
      Parse results in JSON to travel times map.
    • addEdgeWeight

      public void addEdgeWeight(String targetId, Integer travelTime)
      Add travel time to a target
      Parameters:
      targetId - Target ID
      travelTime - Travel time for the target
    • getTravelOptions

      public TravelOptions getTravelOptions()
      Returns:
      the travelOptions
    • getEdgeWeights

      public Map<String,Integer> getEdgeWeights()
      Map of source IDs - travel times
      Returns:
      travel time map
    • getResult

      public org.json.JSONObject getResult()
    • getResultAsMap

      public HashMap<String,PointOfInterestResponse.POI> getResultAsMap() throws IOException
      Throws:
      IOException