ImmutableInstantObjectTimeSeries extends AbstractPreciseObjectTimeSeries<Instant, V> implements InstantObjectTimeSeries<V>, Serializable { public static <V> InstantObjectTimeSeriesBuilder<V> builder() { return new ImmutableInstantObjectTimeSeriesBuilder<V>(); } ImmutableInstantObjectTimeSeries(long[] instants, V[] values); static InstantObjectTimeSeriesBuilder<V> builder(); @SuppressWarnings("unchecked") static ImmutableInstantObjectTimeSeries<V> ofEmpty(); static ImmutableInstantObjectTimeSeries<V> of(Instant instant, V value); static ImmutableInstantObjectTimeSeries<V> of(Instant[] instants, V[] values); static ImmutableInstantObjectTimeSeries<V> of(long[] instants, V[] values); static ImmutableInstantObjectTimeSeries<V> of(Collection<Instant> instants, Collection<V> values); @SuppressWarnings("unchecked") static ImmutableInstantObjectTimeSeries<V> of(PreciseObjectTimeSeries<?, V> timeSeries); static ImmutableInstantObjectTimeSeries<V> from(ObjectTimeSeries<Instant, V> timeSeries); @Override int size(); @Override boolean containsTime(long instant); @Override V getValue(long instant); @Override long getTimeAtIndexFast(int index); @Override V getValueAtIndex(int index); @Override long getEarliestTimeFast(); @Override V getEarliestValue(); @Override long getLatestTimeFast(); @Override V getLatestValue(); @Override long[] timesArrayFast(); @Override V[] valuesArray(); @Override InstantObjectEntryIterator<V> iterator(); @Override InstantObjectTimeSeries<V> subSeries(Instant startInstant, Instant endInstant); @Override InstantObjectTimeSeries<V> subSeries(Instant startInstant, boolean includeStart, Instant endInstant, boolean includeEnd); @Override InstantObjectTimeSeries<V> subSeriesFast(long startInstant, long endInstant); @Override InstantObjectTimeSeries<V> subSeriesFast(long startInstant, boolean includeStart, long endInstant, boolean includeEnd); @Override InstantObjectTimeSeries<V> head(int numItems); @Override InstantObjectTimeSeries<V> tail(int numItems); @Override @SuppressWarnings("unchecked") InstantObjectTimeSeries<V> lag(int days); @Override ImmutableInstantObjectTimeSeries<V> newInstance(Instant[] dates, V[] values); @Override InstantObjectTimeSeries<V> operate(UnaryOperator<V> operator); @Override InstantObjectTimeSeries<V> operate(V other, BinaryOperator<V> operator); @Override @SuppressWarnings("unchecked") InstantObjectTimeSeries<V> operate(PreciseObjectTimeSeries<?, V> other, BinaryOperator<V> operator); @SuppressWarnings("unchecked") @Override InstantObjectTimeSeries<V> unionOperate(PreciseObjectTimeSeries<?, V> other, BinaryOperator<V> operator); @Override InstantObjectTimeSeries<V> intersectionFirstValue(PreciseObjectTimeSeries<?, V> other); @Override InstantObjectTimeSeries<V> intersectionSecondValue(PreciseObjectTimeSeries<?, V> other); @Override InstantObjectTimeSeries<V> noIntersectionOperation(PreciseObjectTimeSeries<?, V> other); @Override InstantObjectTimeSeriesBuilder<V> toBuilder(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_builder_putAll_Instant_mismatchedArrays() { InstantObjectTimeSeriesBuilder<Float> bld = ImmutableInstantObjectTimeSeries.builder(); Instant[] inDates = new Instant[] {Instant.ofEpochSecond(2222), Instant.ofEpochSecond(3333)}; Float[] inValues = new Float[] {2.0f, 3.0f, 1.0f}; bld.putAll(inDates, inValues); }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_builder_putAll_long_mismatchedArrays() { InstantObjectTimeSeriesBuilder<Float> bld = ImmutableInstantObjectTimeSeries.builder(); long[] inDates = new long[] {2222_000_000_000L, 3333_000_000_000L}; Float[] inValues = new Float[] {2.0f, 3.0f, 1.0f}; bld.putAll(inDates, inValues); }