@@ -0,0 +1,1049 @@
+package cz.cuni.mff.d3s.spl.core.data.storage;%0A%0Aimport java.util.Collections;%0Aimport java.util.SortedMap;%0Aimport java.util.TreeMap;%0A%0Aimport cz.cuni.mff.d3s.spl.core.data.SampleStorage;%0A%0A/** Stores measured samples in memory. */%0Apublic class InMemorySamples implements SampleStorage %7B%0A%0A%09private SortedMap%3CLong, Long%3E data = new TreeMap%3C%3E();%0A%09private String id = %22%22;%0A%09%0A%09public InMemorySamples(String id) %7B%0A%09%09this.id = id;%0A%09%7D%0A%0A%09@Override%0A%09public void add(long sample, long clock) %7B%0A%09%09data.put(clock, sample);%0A%09%7D%0A%0A%09@Override%0A%09public SortedMap%3CLong, Long%3E get(long startTime, long endTime) %7B%0A%09%09return Collections.unmodifiableSortedMap(data%0A%09%09%09%09.subMap(startTime, endTime));%0A%09%7D%0A%09%0A%09@Override%0A%09public String toString() %7B%0A%09%09return String.format(%22Samples%5B%25s%5D(%25d)%22, id, data.size());%0A%09%7D%0A%0A%09@Override%0A%09public boolean equals(Object otherObj) %7B%0A%09%09if (this == otherObj) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%09%09%0A%09%09if (!(otherObj instanceof InMemorySamples)) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09%0A%09%09InMemorySamples other = (InMemorySamples) otherObj;%0A%09%09%0A%09%09return this.id.equals(other.id);%0A%09%7D%0A%0A%7D%0A

Add simple SampleStorage implementation