double[] starts_S2 = new double[] {0.3, 0.4, 0.5};
double[] ends_S1 = new double[] {0.5, 0.6, 0.7};
double[] ends_S2 = new double[] {0.7, 0.8, 0.9};
double[][] starts = new double[][] {starts_S1, starts_S2};
double[][] ends = new double[][] {ends_S1, ends_S2};
DefaultIntervalCategoryDataset d1 = new DefaultIntervalCategoryDataset(
new Comparable[] {"Series 1", "Series 2"},
new Comparable[] {"Category 1", "Category 2", "Category 3"},
DataUtilities.createNumberArray2D(starts),
DataUtilities.createNumberArray2D(ends));
d1.setEndValue(0, "Category 2", new Double(99.9));
assertEquals(new Double(99.9), d1.getEndValue("Series 1",
"Category 2"));
boolean pass = false;
try {
d1.setEndValue(-1, "Category 2", new Double(99.9));
}
catch (IllegalArgumentException e) {
pass = true;
}
assertTrue(pass);
pass = false;
try {
d1.setEndValue(2, "Category 2", new Double(99.9));
}
catch (IllegalArgumentException e) {
pass = true;
}
assertTrue(pass);