@Test public void testAdd() { final String labelA = "Image A"; final String labelB = "Image B"; final String header1 = "Measurement 1"; final String header2 = "Measurement 2"; SharedTable.add(labelB, header2, 2.0); SharedTable.add(labelA, header1, 1.0); SharedTable.add(labelA, header1, 1.0); SharedTable.add(labelA, header2, 2.0); SharedTable.add(labelA, header2, 3.0); final Table<DefaultColumn<Double>, Double> table = SharedTable.getTable(); assertEquals("Wrong number of columns", 2, table.getColumnCount()); assertEquals("Wrong number of rows", 3, table.getRowCount()); final DefaultColumn<Double> column1 = table.get(header1); assertEquals("Cell should be empty", EMPTY_CELL, column1.get(0)); assertEquals("Wrong number of empty cells", 1, column1.stream().filter( Objects::isNull).count()); final DefaultColumn<Double> column2 = table.get(header2); assertEquals("Cell contains wrong value", 3.0, column2.get(1), 1e-12); assertEquals("Wrong number of empty cells", 0, column2.stream().filter( Objects::isNull).count()); assertEquals("Label on the wrong row", 0, table.getRowIndex(labelB)); }
public static void add(final String label, final String header, final long value) { add(label, header, new Double(value)); }
SharedTable { public static void add(final String label, final String header, final long value) { add(label, header, new Double(value)); } }
SharedTable { public static void add(final String label, final String header, final long value) { add(label, header, new Double(value)); } private  SharedTable(); }
SharedTable { public static void add(final String label, final String header, final long value) { add(label, header, new Double(value)); } private  SharedTable(); static void add(final String label, final String header,
		final long value); static void add(final String label, final String header,
		final double value); static void add(final String label, final String header,
		final Double value); static Table<DefaultColumn<Double>, Double> getTable(); static boolean hasData(); static void reset(); }
SharedTable { public static void add(final String label, final String header, final long value) { add(label, header, new Double(value)); } private  SharedTable(); static void add(final String label, final String header,
		final long value); static void add(final String label, final String header,
		final double value); static void add(final String label, final String header,
		final Double value); static Table<DefaultColumn<Double>, Double> getTable(); static boolean hasData(); static void reset(); static final Double EMPTY_CELL; }