@Test public void should_return_correct_key(){ long[] index = doubleTimeSeries.index(); Assert.assertEquals(3, index.length); Assert.assertEquals(c1.getTimeInMillis(), index[0]); Assert.assertEquals(c2.getTimeInMillis(), index[1]); Assert.assertEquals(c3.getTimeInMillis(), index[2]); }
public long [] index(){ List<Long> idxList = new ArrayList<>(indexMap.keySet()); long[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Long[idxList.size()])); Arrays.sort(idx); return idx; }
DoubleTimeSeries implements Iterable<DoubleTimeSeries.Tuple> { public long [] index(){ List<Long> idxList = new ArrayList<>(indexMap.keySet()); long[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Long[idxList.size()])); Arrays.sort(idx); return idx; } }
DoubleTimeSeries implements Iterable<DoubleTimeSeries.Tuple> { public long [] index(){ List<Long> idxList = new ArrayList<>(indexMap.keySet()); long[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Long[idxList.size()])); Arrays.sort(idx); return idx; }  }
DoubleTimeSeries implements Iterable<DoubleTimeSeries.Tuple> { public long [] index(){ List<Long> idxList = new ArrayList<>(indexMap.keySet()); long[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Long[idxList.size()])); Arrays.sort(idx); return idx; }  void add(Date date, double data); void add(long date, double data); int count(); double getByIdx(int idx); double getByDate(Date date); double getByDate(long datetime); double ago(int ago); long [] index(); long firstDateTime(); long lastDateTime(); int firstIndex(); int lastIndex(); double first(); double last(); Iterator<Tuple> iterator(); @Override boolean equals(Object o); @Override int hashCode(); List<Long> getDatetimeSeries(); void setDatetimeSeries(List<Long> datetimeSeries); Map<Long, Integer> getIndexMap(); void setIndexMap(Map<Long, Integer> indexMap); List<Double> getDataSeries(); void setDataSeries(List<Double> dataSeries); int getCurrIdx(); void setCurrIdx(int currIdx); long getCurrTime(); void setCurrTime(long currTime); }
DoubleTimeSeries implements Iterable<DoubleTimeSeries.Tuple> { public long [] index(){ List<Long> idxList = new ArrayList<>(indexMap.keySet()); long[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Long[idxList.size()])); Arrays.sort(idx); return idx; }  void add(Date date, double data); void add(long date, double data); int count(); double getByIdx(int idx); double getByDate(Date date); double getByDate(long datetime); double ago(int ago); long [] index(); long firstDateTime(); long lastDateTime(); int firstIndex(); int lastIndex(); double first(); double last(); Iterator<Tuple> iterator(); @Override boolean equals(Object o); @Override int hashCode(); List<Long> getDatetimeSeries(); void setDatetimeSeries(List<Long> datetimeSeries); Map<Long, Integer> getIndexMap(); void setIndexMap(Map<Long, Integer> indexMap); List<Double> getDataSeries(); void setDataSeries(List<Double> dataSeries); int getCurrIdx(); void setCurrIdx(int currIdx); long getCurrTime(); void setCurrTime(long currTime);  }