Class StatisticResult
java.lang.Object
com.targomo.client.api.response.statistics.StatisticResult
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAggregationToMinute(Integer statisticId, Integer startMinute, Integer endMinute, java.util.function.ToDoubleFunction<java.util.stream.DoubleStream> aggregatorFunction) This method returns the aggragtion value for all values for the specified statistic and the given minute (starting from 0).getAggregationToMinute(Integer statisticId, Integer endMinute, java.util.function.ToDoubleFunction<java.util.stream.DoubleStream> aggregatorFunction) This method returns the aggragtion value for all values for the specified statistic and the given minute (starting from 0).parseReachableStatisticsResult(org.json.JSONObject result) toString()
-
Constructor Details
-
StatisticResult
- Parameters:
options- Travel configurationjsonResult- Result as json object
-
-
Method Details
-
parseReachableStatisticsResult
- Parameters:
result- result as json object- Returns:
- Map of targets with reachability and statistics
-
getAggregationToMinute
public OptionalDouble getAggregationToMinute(Integer statisticId, Integer endMinute, java.util.function.ToDoubleFunction<java.util.stream.DoubleStream> aggregatorFunction) This method returns the aggragtion value for all values for the specified statistic and the given minute (starting from 0). So you can use this method to generate the sum or the average of the reachable "targets" for a statistic and minute.- Parameters:
statisticId- the id of the statisticendMinute- - the minute to which we want to aggregate (inclusive)aggregatorFunction- the function that we want to use to aggregate the found values- Returns:
- the result of the aggregation
- Throws:
NullPointerException- if no statistics have been set or there are no values for the current statistic id
-
getAggregationToMinute
public OptionalDouble getAggregationToMinute(Integer statisticId, Integer startMinute, Integer endMinute, java.util.function.ToDoubleFunction<java.util.stream.DoubleStream> aggregatorFunction) This method returns the aggragtion value for all values for the specified statistic and the given minute (starting from 0). So you can use this method to generate the sum or the average of the reachable "targets" for a statistic and minute.- Parameters:
statisticId- the id of the statisticstartMinute- - the minute of the interval to start from (inclusive)endMinute- - the minute to which we want to aggregate (inclusive)aggregatorFunction- the function that we want to use to aggregate the found values- Returns:
- the result of the aggregation
- Throws:
NullPointerException- if no statistics have been set or there are no values for the current statistic id
-
getStatistics
-
getReachableTargets
-
getTargetTravelTimes
-
toString
-