package cz.cuni.mff.d3s.spl.core.data.artificial;

import cz.cuni.mff.d3s.spl.agent.Access;
import cz.cuni.mff.d3s.spl.core.data.SampleStorage;
import cz.cuni.mff.d3s.spl.core.data.SerieDataSource;
import cz.cuni.mff.d3s.spl.core.data.Statistics;
import cz.cuni.mff.d3s.spl.core.data.storage.OriginalSerieDataSource;

public class ArtificialSerieDataSource extends OriginalSerieDataSource {

	public ArtificialSerieDataSource(String id) {
		super(Access.getSampleStorage("ARTIFICIAL:" + id));
	}

	private ArtificialSerieDataSource() {
		this("");
	}
	
	public void addSample(long sampleNanos, long clockMillis) {
		getStorage().add(sampleNanos, clockMillis);
	}
}

@@ -44,16 +44,67 @@
 icial;%0A%0A
+import java.util.Map;%0Aimport java.util.SortedMap;%0A%0A
 import c
@@ -707,10 +707,485 @@
 is);%0A%09%7D%0A
+%09%0A%09public String dumpAllSamples() %7B%0A%09%09SortedMap%3CLong, Long%3E allSamples = getStorage().get(Long.MIN_VALUE, Long.MAX_VALUE);%0A%09%09StringBuilder result = new StringBuilder();%0A%09%09for (Map.Entry%3CLong, Long%3E sample : allSamples.entrySet()) %7B%0A%09%09%09result.append(formatSample(sample.getKey(), sample.getValue()));%0A%09%09%09result.append(%22 %22);%0A%09%09%7D%0A%09%09return result.toString().trim();%0A%09%7D%0A%09%0A%09private String formatSample(long clock, long value) %7B%0A%09%09return String.format(%22(%25d, %25d)%22, clock, value);%0A%09%7D%0A
 %7D%0A

Add dump function to ArtificialSerieDataSource