RegularTimeSeriesIndex extends AbstractTimeSeriesIndex { public static RegularTimeSeriesIndex create(Instant start, Instant end, Duration spacing) { Objects.requireNonNull(start); Objects.requireNonNull(end); Objects.requireNonNull(spacing); return new RegularTimeSeriesIndex(start.toEpochMilli(), end.toEpochMilli(), spacing.toMillis()); } RegularTimeSeriesIndex(long startTime, long endTime, long spacing); static RegularTimeSeriesIndex create(Instant start, Instant end, Duration spacing); static RegularTimeSeriesIndex create(Interval interval, Duration spacing); static RegularTimeSeriesIndex parseJson(JsonParser parser); long getStartTime(); long getEndTime(); long getSpacing(); @Override int getPointCount(); @Override long getTimeAt(int point); @Override int hashCode(); @Override boolean equals(Object obj); @Override String getType(); @Override void writeJson(JsonGenerator generator); @Override Iterator<Instant> iterator(); @Override Stream<Instant> stream(); @Override String toString(); static final String TYPE; }
@Test(expected = IllegalArgumentException.class) public void testContructorError() { RegularTimeSeriesIndex.create(Interval.parse("2015-01-01T00:00:00Z/2015-01-01T00:10:00Z"), Duration.ofMinutes(15)); }
@Test(expected = IllegalArgumentException.class) public void testContructorErrorPointCount() { RegularTimeSeriesIndex.create(Interval.parse("2000-01-01T00:00:00Z/2100-01-01T00:10:00Z"), Duration.ofSeconds(1)); }