ImmutableLocalDateDoubleTimeSeries extends AbstractLocalDateDoubleTimeSeries implements LocalDateDoubleTimeSeries, Serializable { public static ImmutableLocalDateDoubleTimeSeries of(LocalDate date, double value) { Objects.requireNonNull(date, "date"); int[] timesArray = new int[] {LocalDateToIntConverter.convertToInt(date)}; double[] valuesArray = new double[] {value}; return new ImmutableLocalDateDoubleTimeSeries(timesArray, valuesArray); } ImmutableLocalDateDoubleTimeSeries(int[] times, double[] values); static LocalDateDoubleTimeSeriesBuilder builder(); static ImmutableLocalDateDoubleTimeSeries of(LocalDate date, double value); static ImmutableLocalDateDoubleTimeSeries of(LocalDate[] dates, Double[] values); static ImmutableLocalDateDoubleTimeSeries of(LocalDate[] dates, double[] values); static ImmutableLocalDateDoubleTimeSeries of(int[] dates, double[] values); static ImmutableLocalDateDoubleTimeSeries of(Collection<LocalDate> dates, Collection<Double> values); static ImmutableLocalDateDoubleTimeSeries of(DateDoubleTimeSeries<?> timeSeries); static ImmutableLocalDateDoubleTimeSeries from(DoubleTimeSeries<LocalDate> timeSeries); @Override int size(); @Override boolean containsTime(int date); @Override Double getValue(int date); @Override int getTimeAtIndexFast(int index); @Override double getValueAtIndexFast(int index); @Override int getEarliestTimeFast(); @Override double getEarliestValueFast(); @Override int getLatestTimeFast(); @Override double getLatestValueFast(); @Override int[] timesArrayFast(); @Override double[] valuesArrayFast(); @Override LocalDateDoubleTimeSeries subSeriesFast(int startTime, boolean includeStart, int endTime, boolean includeEnd); @Override LocalDateDoubleTimeSeries head(int numItems); @Override LocalDateDoubleTimeSeries tail(int numItems); @Override ImmutableLocalDateDoubleTimeSeries newInstance(LocalDate[] dates, Double[] values); @Override LocalDateDoubleTimeSeries operate(UnaryOperator operator); @Override LocalDateDoubleTimeSeries operate(double other, BinaryOperator operator); @Override LocalDateDoubleTimeSeriesBuilder toBuilder(); LocalDateDoubleTimeSeries withValues(double[] values); static final ImmutableLocalDateDoubleTimeSeries EMPTY_SERIES; }
@Test(expectedExceptions = NullPointerException.class) public void test_of_LD_double_null() { ImmutableLocalDateDoubleTimeSeries.of((LocalDate) null, 2.0); }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_of_LDArray_DoubleArray_wrongOrder() { LocalDate[] inDates = new LocalDate[] {LocalDate.of(2012, 6, 30), LocalDate.of(2012, 7, 1), LocalDate.of(2012, 6, 1)}; Double[] inValues = new Double[] {2.0, 3.0, 1.0}; ImmutableLocalDateDoubleTimeSeries.of(inDates, inValues); }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_of_LDArray_DoubleArray_mismatchedArrays() { LocalDate[] inDates = new LocalDate[] {LocalDate.of(2012, 6, 30)}; Double[] inValues = new Double[] {2.0, 3.0}; ImmutableLocalDateDoubleTimeSeries.of(inDates, inValues); }
@Test(expectedExceptions = NullPointerException.class) public void test_of_LDArray_DoubleArray_nullDates() { Double[] inValues = new Double[] {2.0, 3.0, 1.0}; ImmutableLocalDateDoubleTimeSeries.of((LocalDate[]) null, inValues); }
@Test(expectedExceptions = NullPointerException.class) public void test_of_LDArray_DoubleArray_nullValues() { LocalDate[] inDates = new LocalDate[] {LocalDate.of(2012, 6, 30), LocalDate.of(2012, 7, 1), LocalDate.of(2012, 6, 1)}; ImmutableLocalDateDoubleTimeSeries.of(inDates, (Double[]) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_of_LDArray_doubleArray_wrongOrder() { LocalDate[] inDates = new LocalDate[] {LocalDate.of(2012, 6, 30), LocalDate.of(2012, 7, 1), LocalDate.of(2012, 6, 1)}; double[] inValues = new double[] {2.0, 3.0, 1.0}; ImmutableLocalDateDoubleTimeSeries.of(inDates, inValues); }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_of_LDArray_doubleArray_mismatchedArrays() { LocalDate[] inDates = new LocalDate[] {LocalDate.of(2012, 6, 30)}; double[] inValues = new double[] {2.0, 3.0}; ImmutableLocalDateDoubleTimeSeries.of(inDates, inValues); }
@Test(expectedExceptions = NullPointerException.class) public void test_of_LDArray_doubleArray_nullDates() { double[] inValues = new double[] {2.0, 3.0, 1.0}; ImmutableLocalDateDoubleTimeSeries.of((LocalDate[]) null, inValues); }
@Test(expectedExceptions = NullPointerException.class) public void test_of_LDArray_doubleArray_nullValues() { LocalDate[] inDates = new LocalDate[] {LocalDate.of(2012, 6, 30), LocalDate.of(2012, 7, 1), LocalDate.of(2012, 6, 1)}; ImmutableLocalDateDoubleTimeSeries.of(inDates, (double[]) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_of_intArray_doubleArray_wrongOrder() { int[] inDates = new int[] {20120630, 20120701, 20120601}; double[] inValues = new double[] {2.0, 3.0, 1.0}; ImmutableLocalDateDoubleTimeSeries.of(inDates, inValues); }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_of_intArray_doubleArray_mismatchedArrays() { int[] inDates = new int[] {20120630}; double[] inValues = new double[] {2.0, 3.0}; ImmutableLocalDateDoubleTimeSeries.of(inDates, inValues); }
@Test(expectedExceptions = NullPointerException.class) public void test_of_intArray_doubleArray_nullDates() { double[] inValues = new double[] {2.0, 3.0, 1.0}; ImmutableLocalDateDoubleTimeSeries.of((int[]) null, inValues); }
@Test(expectedExceptions = NullPointerException.class) public void test_of_intArray_doubleArray_nullValues() { int[] inDates = new int[] {20120630, 20120701}; ImmutableLocalDateDoubleTimeSeries.of(inDates, (double[]) null); }