ImmutableInstantDoubleTimeSeries extends AbstractInstantDoubleTimeSeries implements InstantDoubleTimeSeries, Serializable { public static InstantDoubleTimeSeriesBuilder builder() { return new ImmutableInstantDoubleTimeSeriesBuilder(); } ImmutableInstantDoubleTimeSeries(long[] nanos, double[] values); static InstantDoubleTimeSeriesBuilder builder(); static ImmutableInstantDoubleTimeSeries of(Instant instant, double value); static ImmutableInstantDoubleTimeSeries of(Instant[] instants, Double[] values); static ImmutableInstantDoubleTimeSeries of(Instant[] instants, double[] values); static ImmutableInstantDoubleTimeSeries of(long[] instants, double[] values); static ImmutableInstantDoubleTimeSeries of(Collection<Instant> instants, Collection<Double> values); static ImmutableInstantDoubleTimeSeries of(PreciseDoubleTimeSeries<?> timeSeries); static ImmutableInstantDoubleTimeSeries from(DoubleTimeSeries<Instant> timeSeries); @Override int size(); @Override boolean containsTime(long instant); @Override Double getValue(long instant); @Override long getTimeAtIndexFast(int index); @Override double getValueAtIndexFast(int index); @Override long getEarliestTimeFast(); @Override double getEarliestValueFast(); @Override long getLatestTimeFast(); @Override double getLatestValueFast(); @Override long[] timesArrayFast(); @Override double[] valuesArrayFast(); @Override InstantDoubleTimeSeries subSeriesFast(long startTime, boolean includeStart, long endTime, boolean includeEnd); @Override InstantDoubleTimeSeries head(int numItems); @Override InstantDoubleTimeSeries tail(int numItems); @Override ImmutableInstantDoubleTimeSeries newInstance(Instant[] instants, Double[] values); @Override InstantDoubleTimeSeries operate(UnaryOperator operator); @Override InstantDoubleTimeSeries operate(double other, BinaryOperator operator); @Override InstantDoubleTimeSeriesBuilder toBuilder(); static final ImmutableInstantDoubleTimeSeries EMPTY_SERIES; }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_builder_putAll_Instant_mismatchedArrays() { InstantDoubleTimeSeriesBuilder bld = ImmutableInstantDoubleTimeSeries.builder(); Instant[] inDates = new Instant[] {Instant.ofEpochSecond(2222), Instant.ofEpochSecond(3333)}; double[] inValues = new double[] {2.0, 3.0, 1.0}; bld.putAll(inDates, inValues); }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_builder_putAll_long_mismatchedArrays() { InstantDoubleTimeSeriesBuilder bld = ImmutableInstantDoubleTimeSeries.builder(); long[] inDates = new long[] {2222_000_000_000L, 3333_000_000_000L}; double[] inValues = new double[] {2.0, 3.0, 1.0}; bld.putAll(inDates, inValues); }