@Test public void testGetRangeBounds() { XYSeriesCollection dataset = new XYSeriesCollection(); assertNull(dataset.getRangeBounds(false)); assertNull(dataset.getRangeBounds(true)); XYSeries series = new XYSeries("S1"); dataset.addSeries(series); assertNull(dataset.getRangeBounds(false)); assertNull(dataset.getRangeBounds(true)); series.add(1.0, 1.1); assertEquals(new Range(1.1, 1.1), dataset.getRangeBounds(false)); assertEquals(new Range(1.1, 1.1), dataset.getRangeBounds(true)); series.add(-1.0, -1.1); assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(false)); assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(true)); series.add(0.0, null); assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(false)); assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(true)); XYSeries s2 = new XYSeries("S2"); dataset.addSeries(s2); assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(false)); assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(true)); s2.add(2.0, 5.0); assertEquals(new Range(-1.1, 5.0), dataset.getRangeBounds(false)); assertEquals(new Range(-1.1, 5.0), dataset.getRangeBounds(true)); }
@Override public Range getRangeBounds(boolean includeInterval) { double lower = Double.POSITIVE_INFINITY; double upper = Double.NEGATIVE_INFINITY; int seriesCount = getSeriesCount(); for (int s = 0; s < seriesCount; s++) { XYSeries series = getSeries(s); double minY = series.getMinY(); if (!Double.isNaN(minY)) { lower = Math.min(lower, minY); } double maxY = series.getMaxY(); if (!Double.isNaN(maxY)) { upper = Math.max(upper, maxY); } } if (lower > upper) { return null; } else { return new Range(lower, upper); } }
XYSeriesCollection extends AbstractIntervalXYDataset implements IntervalXYDataset, DomainInfo, RangeInfo, 
        VetoableChangeListener, PublicCloneable, Serializable { @Override public Range getRangeBounds(boolean includeInterval) { double lower = Double.POSITIVE_INFINITY; double upper = Double.NEGATIVE_INFINITY; int seriesCount = getSeriesCount(); for (int s = 0; s < seriesCount; s++) { XYSeries series = getSeries(s); double minY = series.getMinY(); if (!Double.isNaN(minY)) { lower = Math.min(lower, minY); } double maxY = series.getMaxY(); if (!Double.isNaN(maxY)) { upper = Math.max(upper, maxY); } } if (lower > upper) { return null; } else { return new Range(lower, upper); } } }
XYSeriesCollection extends AbstractIntervalXYDataset implements IntervalXYDataset, DomainInfo, RangeInfo, 
        VetoableChangeListener, PublicCloneable, Serializable { @Override public Range getRangeBounds(boolean includeInterval) { double lower = Double.POSITIVE_INFINITY; double upper = Double.NEGATIVE_INFINITY; int seriesCount = getSeriesCount(); for (int s = 0; s < seriesCount; s++) { XYSeries series = getSeries(s); double minY = series.getMinY(); if (!Double.isNaN(minY)) { lower = Math.min(lower, minY); } double maxY = series.getMaxY(); if (!Double.isNaN(maxY)) { upper = Math.max(upper, maxY); } } if (lower > upper) { return null; } else { return new Range(lower, upper); } } XYSeriesCollection();  XYSeriesCollection(XYSeries series); }
XYSeriesCollection extends AbstractIntervalXYDataset implements IntervalXYDataset, DomainInfo, RangeInfo, 
        VetoableChangeListener, PublicCloneable, Serializable { @Override public Range getRangeBounds(boolean includeInterval) { double lower = Double.POSITIVE_INFINITY; double upper = Double.NEGATIVE_INFINITY; int seriesCount = getSeriesCount(); for (int s = 0; s < seriesCount; s++) { XYSeries series = getSeries(s); double minY = series.getMinY(); if (!Double.isNaN(minY)) { lower = Math.min(lower, minY); } double maxY = series.getMaxY(); if (!Double.isNaN(maxY)) { upper = Math.max(upper, maxY); } } if (lower > upper) { return null; } else { return new Range(lower, upper); } } XYSeriesCollection();  XYSeriesCollection(XYSeries series); @Override DomainOrder getDomainOrder(); void addSeries(XYSeries series); void removeSeries(int series); void removeSeries(XYSeries series); void removeAllSeries(); @Override int getSeriesCount(); List<XYSeries> getSeries(); int indexOf(XYSeries series); XYSeries getSeries(int series); XYSeries getSeries(Comparable key); @Override Comparable getSeriesKey(int series); int getSeriesIndex(Comparable key); @Override int getItemCount(int series); @Override Number getX(int series, int item); @Override Number getStartX(int series, int item); @Override Number getEndX(int series, int item); @Override Number getY(int series, int index); @Override Number getStartY(int series, int item); @Override Number getEndY(int series, int item); @Override boolean equals(Object obj); @Override Object clone(); @Override int hashCode(); @Override double getDomainLowerBound(boolean includeInterval); @Override double getDomainUpperBound(boolean includeInterval); @Override Range getDomainBounds(boolean includeInterval); double getIntervalWidth(); void setIntervalWidth(double width); double getIntervalPositionFactor(); void setIntervalPositionFactor(double factor); boolean isAutoWidth(); void setAutoWidth(boolean b); @Override Range getRangeBounds(boolean includeInterval); @Override double getRangeLowerBound(boolean includeInterval); @Override double getRangeUpperBound(boolean includeInterval); @Override void vetoableChange(PropertyChangeEvent e); }
XYSeriesCollection extends AbstractIntervalXYDataset implements IntervalXYDataset, DomainInfo, RangeInfo, 
        VetoableChangeListener, PublicCloneable, Serializable { @Override public Range getRangeBounds(boolean includeInterval) { double lower = Double.POSITIVE_INFINITY; double upper = Double.NEGATIVE_INFINITY; int seriesCount = getSeriesCount(); for (int s = 0; s < seriesCount; s++) { XYSeries series = getSeries(s); double minY = series.getMinY(); if (!Double.isNaN(minY)) { lower = Math.min(lower, minY); } double maxY = series.getMaxY(); if (!Double.isNaN(maxY)) { upper = Math.max(upper, maxY); } } if (lower > upper) { return null; } else { return new Range(lower, upper); } } XYSeriesCollection();  XYSeriesCollection(XYSeries series); @Override DomainOrder getDomainOrder(); void addSeries(XYSeries series); void removeSeries(int series); void removeSeries(XYSeries series); void removeAllSeries(); @Override int getSeriesCount(); List<XYSeries> getSeries(); int indexOf(XYSeries series); XYSeries getSeries(int series); XYSeries getSeries(Comparable key); @Override Comparable getSeriesKey(int series); int getSeriesIndex(Comparable key); @Override int getItemCount(int series); @Override Number getX(int series, int item); @Override Number getStartX(int series, int item); @Override Number getEndX(int series, int item); @Override Number getY(int series, int index); @Override Number getStartY(int series, int item); @Override Number getEndY(int series, int item); @Override boolean equals(Object obj); @Override Object clone(); @Override int hashCode(); @Override double getDomainLowerBound(boolean includeInterval); @Override double getDomainUpperBound(boolean includeInterval); @Override Range getDomainBounds(boolean includeInterval); double getIntervalWidth(); void setIntervalWidth(double width); double getIntervalPositionFactor(); void setIntervalPositionFactor(double factor); boolean isAutoWidth(); void setAutoWidth(boolean b); @Override Range getRangeBounds(boolean includeInterval); @Override double getRangeLowerBound(boolean includeInterval); @Override double getRangeUpperBound(boolean includeInterval); @Override void vetoableChange(PropertyChangeEvent e);  }