@Test public void testAdd() { DefaultBoxAndWhiskerXYDataset dataset = new DefaultBoxAndWhiskerXYDataset("S1"); BoxAndWhiskerItem item1 = new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList()); dataset.add(new Date(33L), item1); assertEquals(1.0, dataset.getY(0, 0).doubleValue(), EPSILON); assertEquals(1.0, dataset.getMeanValue(0, 0).doubleValue(), EPSILON); assertEquals(2.0, dataset.getMedianValue(0, 0).doubleValue(), EPSILON); assertEquals(3.0, dataset.getQ1Value(0, 0).doubleValue(), EPSILON); assertEquals(4.0, dataset.getQ3Value(0, 0).doubleValue(), EPSILON); assertEquals(5.0, dataset.getMinRegularValue(0, 0).doubleValue(), EPSILON); assertEquals(6.0, dataset.getMaxRegularValue(0, 0).doubleValue(), EPSILON); assertEquals(7.0, dataset.getMinOutlier(0, 0).doubleValue(), EPSILON); assertEquals(8.0, dataset.getMaxOutlier(0, 0).doubleValue(), EPSILON); assertEquals(new Range(5.0, 6.0), dataset.getRangeBounds(false)); }
public void add(Date date, BoxAndWhiskerItem item) { this.dates.add(date); this.items.add(item); if (this.minimumRangeValue == null) { this.minimumRangeValue = item.getMinRegularValue(); } else { if (item.getMinRegularValue().doubleValue() < this.minimumRangeValue.doubleValue()) { this.minimumRangeValue = item.getMinRegularValue(); } } if (this.maximumRangeValue == null) { this.maximumRangeValue = item.getMaxRegularValue(); } else { if (item.getMaxRegularValue().doubleValue() > this.maximumRangeValue.doubleValue()) { this.maximumRangeValue = item.getMaxRegularValue(); } } this.rangeBounds = new Range(this.minimumRangeValue.doubleValue(), this.maximumRangeValue.doubleValue()); fireDatasetChanged(); }
DefaultBoxAndWhiskerXYDataset extends AbstractXYDataset implements BoxAndWhiskerXYDataset, RangeInfo { public void add(Date date, BoxAndWhiskerItem item) { this.dates.add(date); this.items.add(item); if (this.minimumRangeValue == null) { this.minimumRangeValue = item.getMinRegularValue(); } else { if (item.getMinRegularValue().doubleValue() < this.minimumRangeValue.doubleValue()) { this.minimumRangeValue = item.getMinRegularValue(); } } if (this.maximumRangeValue == null) { this.maximumRangeValue = item.getMaxRegularValue(); } else { if (item.getMaxRegularValue().doubleValue() > this.maximumRangeValue.doubleValue()) { this.maximumRangeValue = item.getMaxRegularValue(); } } this.rangeBounds = new Range(this.minimumRangeValue.doubleValue(), this.maximumRangeValue.doubleValue()); fireDatasetChanged(); } }
DefaultBoxAndWhiskerXYDataset extends AbstractXYDataset implements BoxAndWhiskerXYDataset, RangeInfo { public void add(Date date, BoxAndWhiskerItem item) { this.dates.add(date); this.items.add(item); if (this.minimumRangeValue == null) { this.minimumRangeValue = item.getMinRegularValue(); } else { if (item.getMinRegularValue().doubleValue() < this.minimumRangeValue.doubleValue()) { this.minimumRangeValue = item.getMinRegularValue(); } } if (this.maximumRangeValue == null) { this.maximumRangeValue = item.getMaxRegularValue(); } else { if (item.getMaxRegularValue().doubleValue() > this.maximumRangeValue.doubleValue()) { this.maximumRangeValue = item.getMaxRegularValue(); } } this.rangeBounds = new Range(this.minimumRangeValue.doubleValue(), this.maximumRangeValue.doubleValue()); fireDatasetChanged(); } DefaultBoxAndWhiskerXYDataset(Comparable seriesKey); }
DefaultBoxAndWhiskerXYDataset extends AbstractXYDataset implements BoxAndWhiskerXYDataset, RangeInfo { public void add(Date date, BoxAndWhiskerItem item) { this.dates.add(date); this.items.add(item); if (this.minimumRangeValue == null) { this.minimumRangeValue = item.getMinRegularValue(); } else { if (item.getMinRegularValue().doubleValue() < this.minimumRangeValue.doubleValue()) { this.minimumRangeValue = item.getMinRegularValue(); } } if (this.maximumRangeValue == null) { this.maximumRangeValue = item.getMaxRegularValue(); } else { if (item.getMaxRegularValue().doubleValue() > this.maximumRangeValue.doubleValue()) { this.maximumRangeValue = item.getMaxRegularValue(); } } this.rangeBounds = new Range(this.minimumRangeValue.doubleValue(), this.maximumRangeValue.doubleValue()); fireDatasetChanged(); } DefaultBoxAndWhiskerXYDataset(Comparable seriesKey); @Override double getOutlierCoefficient(); void setOutlierCoefficient(double outlierCoefficient); @Override double getFaroutCoefficient(); void setFaroutCoefficient(double faroutCoefficient); @Override int getSeriesCount(); @Override int getItemCount(int series); void add(Date date, BoxAndWhiskerItem item); @Override Comparable getSeriesKey(int i); BoxAndWhiskerItem getItem(int series, int item); @Override Number getX(int series, int item); Date getXDate(int series, int item); @Override Number getY(int series, int item); @Override Number getMeanValue(int series, int item); @Override Number getMedianValue(int series, int item); @Override Number getQ1Value(int series, int item); @Override Number getQ3Value(int series, int item); @Override Number getMinRegularValue(int series, int item); @Override Number getMaxRegularValue(int series, int item); @Override Number getMinOutlier(int series, int item); @Override Number getMaxOutlier(int series, int item); @Override List<Number> getOutliers(int series, int item); @Override double getRangeLowerBound(boolean includeInterval); @Override double getRangeUpperBound(boolean includeInterval); @Override Range getRangeBounds(boolean includeInterval); @Override boolean equals(Object obj); @Override Object clone(); }
DefaultBoxAndWhiskerXYDataset extends AbstractXYDataset implements BoxAndWhiskerXYDataset, RangeInfo { public void add(Date date, BoxAndWhiskerItem item) { this.dates.add(date); this.items.add(item); if (this.minimumRangeValue == null) { this.minimumRangeValue = item.getMinRegularValue(); } else { if (item.getMinRegularValue().doubleValue() < this.minimumRangeValue.doubleValue()) { this.minimumRangeValue = item.getMinRegularValue(); } } if (this.maximumRangeValue == null) { this.maximumRangeValue = item.getMaxRegularValue(); } else { if (item.getMaxRegularValue().doubleValue() > this.maximumRangeValue.doubleValue()) { this.maximumRangeValue = item.getMaxRegularValue(); } } this.rangeBounds = new Range(this.minimumRangeValue.doubleValue(), this.maximumRangeValue.doubleValue()); fireDatasetChanged(); } DefaultBoxAndWhiskerXYDataset(Comparable seriesKey); @Override double getOutlierCoefficient(); void setOutlierCoefficient(double outlierCoefficient); @Override double getFaroutCoefficient(); void setFaroutCoefficient(double faroutCoefficient); @Override int getSeriesCount(); @Override int getItemCount(int series); void add(Date date, BoxAndWhiskerItem item); @Override Comparable getSeriesKey(int i); BoxAndWhiskerItem getItem(int series, int item); @Override Number getX(int series, int item); Date getXDate(int series, int item); @Override Number getY(int series, int item); @Override Number getMeanValue(int series, int item); @Override Number getMedianValue(int series, int item); @Override Number getQ1Value(int series, int item); @Override Number getQ3Value(int series, int item); @Override Number getMinRegularValue(int series, int item); @Override Number getMaxRegularValue(int series, int item); @Override Number getMinOutlier(int series, int item); @Override Number getMaxOutlier(int series, int item); @Override List<Number> getOutliers(int series, int item); @Override double getRangeLowerBound(boolean includeInterval); @Override double getRangeUpperBound(boolean includeInterval); @Override Range getRangeBounds(boolean includeInterval); @Override boolean equals(Object obj); @Override Object clone();  }