if (start.isAfter(timeSeries.getLatestTime()) || end.isBefore(timeSeries.getEarliestTime())) {
return new SimpleHistoricalTimeSeries(hts.getUniqueId(), ImmutableLocalDateDoubleTimeSeries.EMPTY_SERIES);
}
timeSeries = timeSeries.subSeries(start, true, end, true);
if (((maxPoints != null) && (Math.abs(maxPoints) < timeSeries.size()))) {
timeSeries = maxPoints >= 0 ? timeSeries.head(maxPoints) : timeSeries.tail(-maxPoints);
}
return new SimpleHistoricalTimeSeries(hts.getUniqueId(), timeSeries);
}
//-------------------------------------------------------------------------