/** * Returns the minimum x-value in the dataset. * * @param includeInterval a flag that determines whether or not the * x-interval is taken into account. * * @return The minimum value. */ @Override public double getDomainLowerBound(boolean includeInterval) { return this.intervalDelegate.getDomainLowerBound(includeInterval); }
/** * Returns the maximum x-value in the dataset. * * @param includeInterval a flag that determines whether or not the * x-interval is taken into account. * * @return The maximum value. */ @Override public double getDomainUpperBound(boolean includeInterval) { return this.intervalDelegate.getDomainUpperBound(includeInterval); }
/** * Returns the ending X value for the specified series and item. * * @param series the series index (zero-based). * @param item the item index (zero-based). * * @return The ending X value. */ @Override public Number getEndX(int series, int item) { return this.intervalDelegate.getEndX(series, item); }
/** * Returns the end value of the x-interval for an item within a series. * * @param series the series index. * @param item the item index. * * @return The end value of the x-interval. * * @see #getEndX(int, int) */ public double getEndXValue(int series, int item) { return this.dataset.getXValue(series, item) + (1.0 - getIntervalPositionFactor()) * getIntervalWidth(); }
/** * Returns an independent copy of this dataset. * * @return A clone. * * @throws CloneNotSupportedException if there is some reason that cloning * cannot be performed. */ @Override public Object clone() throws CloneNotSupportedException { CategoryTableXYDataset clone = (CategoryTableXYDataset) super.clone(); clone.values = (DefaultKeyedValues2D) this.values.clone(); clone.intervalDelegate = new IntervalXYDelegate(clone); // need to configure the intervalDelegate to match the original clone.intervalDelegate.setFixedIntervalWidth(getIntervalWidth()); clone.intervalDelegate.setAutoWidth(isAutoWidth()); clone.intervalDelegate.setIntervalPositionFactor( getIntervalPositionFactor()); return clone; }
/** * Returns the range of the values in this dataset's domain. * * @param includeInterval a flag that determines whether or not the * x-interval is taken into account. * * @return The range. */ @Override public Range getDomainBounds(boolean includeInterval) { if (includeInterval) { return this.intervalDelegate.getDomainBounds(includeInterval); } else { return DatasetUtils.iterateDomainBounds(this, includeInterval); } }
/** * returns the full interval width. * * @return The interval width to use. */ public double getIntervalWidth() { return this.intervalDelegate.getIntervalWidth(); }
/** * Returns the interval position factor. * * @return The interval position factor. */ public double getIntervalPositionFactor() { return this.intervalDelegate.getIntervalPositionFactor(); }
/** * Creates a new empty dataset. * * @param autoPrune a flag that controls whether or not x-values are * removed whenever the corresponding y-values are all * {@code null}. */ public DefaultTableXYDataset(boolean autoPrune) { this.autoPrune = autoPrune; this.data = new ArrayList(); this.xPoints = new HashSet(); this.intervalDelegate = new IntervalXYDelegate(this, false); addChangeListener(this.intervalDelegate); }
/** * Tests this collection for equality with an arbitrary object. * * @param obj the object ({@code null} permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYSeriesCollection)) { return false; } XYSeriesCollection that = (XYSeriesCollection) obj; if (!this.intervalDelegate.equals(that.intervalDelegate)) { return false; } return ObjectUtils.equal(this.data, that.data); }
/** * Recalculate the minimum width "from scratch". * * @return The minimum width. */ private double recalculateInterval() { double result = Double.POSITIVE_INFINITY; int seriesCount = this.dataset.getSeriesCount(); for (int series = 0; series < seriesCount; series++) { result = Math.min(result, calculateIntervalForSeries(series)); } return result; }
/** * Returns a clone of this instance. * * @return A clone. * * @throws CloneNotSupportedException if there is a problem. */ @Override public Object clone() throws CloneNotSupportedException { XYSeriesCollection clone = (XYSeriesCollection) super.clone(); clone.data = (List) ObjectUtils.deepClone(this.data); clone.intervalDelegate = (IntervalXYDelegate) this.intervalDelegate.clone(); return clone; }
/** * Returns an independent copy of this dataset. * * @return A clone. * * @throws CloneNotSupportedException if there is some reason that cloning * cannot be performed. */ public Object clone() throws CloneNotSupportedException { CategoryTableXYDataset clone = (CategoryTableXYDataset) super.clone(); clone.values = (DefaultKeyedValues2D) this.values.clone(); clone.intervalDelegate = new IntervalXYDelegate(clone); // need to configure the intervalDelegate to match the original clone.intervalDelegate.setFixedIntervalWidth(getIntervalWidth()); clone.intervalDelegate.setAutoWidth(isAutoWidth()); clone.intervalDelegate.setIntervalPositionFactor( getIntervalPositionFactor()); return clone; }
/** * Returns the start value of the x-interval for an item within a series. * * @param series the series index. * @param item the item index. * * @return The start value of the x-interval. * * @see #getStartX(int, int) */ public double getStartXValue(int series, int item) { return this.dataset.getXValue(series, item) - getIntervalPositionFactor() * getIntervalWidth(); }
/** * Returns the range of the values in this dataset's domain. * * @param includeInterval a flag that determines whether or not the * x-interval is taken into account. * * @return The range. */ public Range getDomainBounds(boolean includeInterval) { if (includeInterval) { return this.intervalDelegate.getDomainBounds(includeInterval); } else { return DatasetUtilities.iterateDomainBounds(this, includeInterval); } }
/** * returns the full interval width. * * @return The interval width to use. */ public double getIntervalWidth() { return this.intervalDelegate.getIntervalWidth(); }
/** * Returns the interval position factor. * * @return The interval position factor. */ public double getIntervalPositionFactor() { return this.intervalDelegate.getIntervalPositionFactor(); }
/** * Creates a new empty dataset. * * @param autoPrune a flag that controls whether or not x-values are * removed whenever the corresponding y-values are all * <code>null</code>. */ public DefaultTableXYDataset(boolean autoPrune) { this.autoPrune = autoPrune; this.data = new ArrayList(); this.xPoints = new HashSet(); this.intervalDelegate = new IntervalXYDelegate(this, false); addChangeListener(this.intervalDelegate); }
/** * Tests this collection for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYSeriesCollection)) { return false; } XYSeriesCollection that = (XYSeriesCollection) obj; if (!this.intervalDelegate.equals(that.intervalDelegate)) { return false; } return ObjectUtilities.equal(this.data, that.data); }
/** * Recalculate the minimum width "from scratch". * * @return The minimum width. */ private double recalculateInterval() { double result = Double.POSITIVE_INFINITY; int seriesCount = this.dataset.getSeriesCount(); for (int series = 0; series < seriesCount; series++) { result = Math.min(result, calculateIntervalForSeries(series)); } return result; }