EmpiricalDensityDataset extends AbstractXYDataset { public Double getX(int series, int bin) { if (series < 0 || series >= d_nSeries) throw new IndexOutOfBoundsException(); return (0.5 + bin) * d_interval + d_bottom; } EmpiricalDensityDataset(int nBins, PlotParameter ... parameters);  EmpiricalDensityDataset(int nBins, MCMCResults r, Parameter p); @Override int getSeriesCount(); @Override Comparable<String> getSeriesKey(int series); Double getX(int series, int bin); Double getY(int series, int bin); int[] getCounts(int series); double[] getDensities(int series); int getItemCount(int series);  }
@Test public void testGetX() throws IOException { d_results.makeSamplesAvailable(); EmpiricalDensityDataset edd = new EmpiricalDensityDataset(N_BINS, d_results, d_parameters[0]); double bottom = s_quantiles1[0]; double top = s_quantiles1[1]; double interval = (top - bottom) / N_BINS; assertEquals((0.5 + 1) * interval + bottom, edd.getX(0, 1), EPSILON); assertEquals((0.5 + 25) * interval + bottom, edd.getX(0, 25), EPSILON); assertEquals((0.5 + 49) * interval + bottom, edd.getX(0, 49), EPSILON); }