use of me.semx11.autotip.stats.StatsDaily in project Hyperium by HyperiumClient.
the class StatsManager method getRange.
/**
* Get the {@link StatsRange} for the specified date range. This method uses {@link
* #get(LocalDate)} to get all the {@link StatsDaily} that are contained within this range.
*
* @param start The starting {@link LocalDate}
* @param end The ending {@link LocalDate}
* @return {@link StatsRange} for the specified date range
*/
public StatsRange getRange(LocalDate start, LocalDate end) {
if (start.isBefore(fileUtil.getFirstDate()))
start = fileUtil.getFirstDate();
if (end.isAfter(LocalDate.now()))
end = LocalDate.now();
StatsRange range = new StatsRange(autotip, start, end);
Stream.iterate(start, date -> date.plusDays(1)).limit(ChronoUnit.DAYS.between(start, end) + 1).forEach(date -> range.merge(get(date)));
return range;
}
Aggregations