@Override public List<T> getValues() { final List<ITimeSeriesPoint<T>> pointsCopy = this.getPoints(); final List<T> retVals = new ArrayList<T>(pointsCopy.size()); for (final ITimeSeriesPoint<T> curPoint : pointsCopy) { retVals.add(curPoint.getValue()); } return retVals; }
@Override public String toString() { final StringBuffer buf = new StringBuffer(); buf.append("Time Series with delta: " + this.deltaTime + " " + this.deltaTimeUnit + " starting at: " + this.getStartTime() + " " + this.timeSeriesTimeUnit); for (final ITimeSeriesPoint<T> curPoint : this.getPoints()) { buf.append(curPoint); } return buf.toString(); }
@Override public List<T> getValues() { final List<ITimeSeriesPoint<T>> pointsCopy = this.getPoints(); final List<T> retVals = new ArrayList<>(pointsCopy.size()); for (final ITimeSeriesPoint<T> curPoint : pointsCopy) { retVals.add(curPoint.getValue()); } return retVals; }
@Override public String toString() { final StringBuffer buf = new StringBuffer(); buf.append("Time Series with delta: " + this.deltaTime + " " + this.deltaTimeUnit + " starting at: " + this.getStartTime() + " " + this.timeSeriesTimeUnit); for (final ITimeSeriesPoint<T> curPoint : this.getPoints()) { buf.append(curPoint); } return buf.toString(); }
/** * Test if values are collected in the correct order. */ @Test public void testValueSort() { final int count = 30; for (int i = 0; i < count; i++) { this.unboundTS.append(Double.valueOf(i)); } for (int i = 0; i < count; i++) { Assert.assertEquals(Double.valueOf(i), this.unboundTS.getPoints().get(i).getValue()); } Assert.assertEquals(count, this.unboundTS.size()); }
/** * Test if newer values are stored in FIFO order. */ @Test public void testKeepNewerValuesInCapacity() { Assert.assertEquals(0, this.boundedTS.size()); int i; final int lastNumber = this.bounds * 2; for (i = 0; i <= lastNumber; i++) { this.boundedTS.append(i); } Assert.assertEquals(Integer.valueOf(lastNumber), this.boundedTS.getPoints().get(this.bounds - 1).getValue()); }