- private ISegmentStore<@NonNull ISegment> fALS = new ArrayListStore<>();
- private ISegmentStore<@NonNull ISegment> fLALS = new LazyArrayListStore<>();
- private ISegmentStore<@NonNull ISegment> fTMS = new TreeMapStore<>();
+ private final ISegmentStore<@NonNull ISegment> fSegStore;
+ private final String fName;
+ private static final Format FORMAT = new DecimalFormat("###,###.##"); //$NON-NLS-1$
+
+ /**
+ * @return The arrays of parameters
+ */
+ @Parameters(name = "{index}: {0}")
+ public static Iterable<Object[]> getParameters() {
+ return Arrays.asList(new Object[][] {
+ { "Array list store", new ArrayListStore<>() },
+ { "Lazy array list store", new LazyArrayListStore<>() },
+ { "Treemap store", new TreeMapStore<>() },
+ });
+ }
+
+ /**
+ * Constructor
+ *
+ * @param name
+ * The name of this test
+ * @param segStore
+ * The segment store to fill for the benchmarks
+ */
+ public SegmentStoreBenchmark(String name, ISegmentStore<@NonNull ISegment> segStore) {
+ fSegStore = segStore;
+ fName = name;
+ }