@@ -0,0 +1,1260 @@
+package cz.cuni.mff.d3s.spl.core.data.storage;%0A%0Aimport java.util.Collection;%0A%0Aimport cz.cuni.mff.d3s.spl.core.data.PrecomputedStatistics;%0Aimport cz.cuni.mff.d3s.spl.core.data.SampleStorage;%0Aimport cz.cuni.mff.d3s.spl.core.data.SerieDataSource;%0Aimport cz.cuni.mff.d3s.spl.core.data.Statistics;%0A%0Apublic class OriginalSerieDataSource implements SerieDataSource %7B%0A%0A%09private SampleStorage samples;%0A%09private long myStartTime;%0A%09private long myEndTime;%0A%0A%09public OriginalSerieDataSource(SampleStorage storage) %7B%0A%09%09this(storage, Long.MIN_VALUE, Long.MAX_VALUE);%0A%09%7D%0A%09%0A%09private OriginalSerieDataSource(SampleStorage storage, long segmentStartTime, long segmentEndTime) %7B%0A%09%09samples = storage;%0A%09%09myStartTime = segmentStartTime;%0A%09%09myEndTime = segmentEndTime;%0A%09%7D%0A%0A%09@Override%0A%09public Statistics get() %7B%0A%09%09Collection%3CLong%3E all = getSamples();%0A%09%09return PrecomputedStatistics.create(all);%09%09%0A%09%7D%0A%0A%09@Override%0A%09public SerieDataSource getSegment(long startTime, long endTime) %7B%0A%09%09return new OriginalSerieDataSource(samples, startTime, endTime);%0A%09%7D%0A%09%0A%09@Override%0A%09public String toString() %7B%0A%09%09return String.format(%22SerieDataSource on '%25s' (%25d)%22,%0A%09%09%09%09samples, getSamples().size());%0A%09%7D%0A%09%0A%09private Collection%3CLong%3E getSamples() %7B%0A%09%09return samples.get(myStartTime, myEndTime).values();%0A%09%7D%0A%7D%0A

Implement source directly working above samples