/** * Removes all bins and sends a {@link DatasetChangeEvent} to all * registered listeners. * * @since 1.0.6 * * @see #addBin(SimpleHistogramBin) */ public void removeAllBins() { this.bins = new ArrayList(); notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Removes all bins and sends a {@link DatasetChangeEvent} to all * registered listeners. * * @since 1.0.6 * * @see #addBin(SimpleHistogramBin) */ public void removeAllBins() { this.bins = new ArrayList(); notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Sets the flag that controls whether or not the bin count is divided by * the bin size in the {@link #getYValue(int, int)} method, and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param adjust the flag. * * @see #getAdjustForBinSize() */ public void setAdjustForBinSize(boolean adjust) { this.adjustForBinSize = adjust; notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Sets the flag that controls whether or not the bin count is divided by * the bin size in the {@link #getYValue(int, int)} method, and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param adjust the flag. * * @see #getAdjustForBinSize() */ public void setAdjustForBinSize(boolean adjust) { this.adjustForBinSize = adjust; notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Removes all current observation data and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @since 1.0.6 * * @see #addObservations(double[]) * @see #removeAllBins() */ public void clearObservations() { Iterator iterator = this.bins.iterator(); while (iterator.hasNext()) { SimpleHistogramBin bin = (SimpleHistogramBin) iterator.next(); bin.setItemCount(0); } notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Removes all current observation data and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @since 1.0.6 * * @see #addObservations(double[]) * @see #removeAllBins() */ public void clearObservations() { Iterator iterator = this.bins.iterator(); while (iterator.hasNext()) { SimpleHistogramBin bin = (SimpleHistogramBin) iterator.next(); bin.setItemCount(0); } notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Adds a set of values to the dataset and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param values the values ({@code null} not permitted). * * @see #clearObservations() */ public void addObservations(double[] values) { for (int i = 0; i < values.length; i++) { addObservation(values[i], false); } notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Adds a set of values to the dataset and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param values the values (<code>null</code> not permitted). * * @see #clearObservations() */ public void addObservations(double[] values) { for (int i = 0; i < values.length; i++) { addObservation(values[i], false); } notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Adds an observation to the dataset (by incrementing the item count for * the appropriate bin). A runtime exception is thrown if the value does * not fit into any bin. * * @param value the value. * @param notify send {@link DatasetChangeEvent} to listeners? */ public void addObservation(double value, boolean notify) { boolean placed = false; Iterator iterator = this.bins.iterator(); while (iterator.hasNext() && !placed) { SimpleHistogramBin bin = (SimpleHistogramBin) iterator.next(); if (bin.accepts(value)) { bin.setItemCount(bin.getItemCount() + 1); placed = true; } } if (!placed) { throw new RuntimeException("No bin."); } if (notify) { notifyListeners(new DatasetChangeEvent(this, this)); } }
/** * Adds an observation to the dataset (by incrementing the item count for * the appropriate bin). A runtime exception is thrown if the value does * not fit into any bin. * * @param value the value. * @param notify send {@link DatasetChangeEvent} to listeners? */ public void addObservation(double value, boolean notify) { boolean placed = false; Iterator iterator = this.bins.iterator(); while (iterator.hasNext() && !placed) { SimpleHistogramBin bin = (SimpleHistogramBin) iterator.next(); if (bin.accepts(value)) { bin.setItemCount(bin.getItemCount() + 1); placed = true; } } if (!placed) { throw new RuntimeException("No bin."); } if (notify) { notifyListeners(new DatasetChangeEvent(this, this)); } }