public class OverwritableHistogramDataset
extends org.jfree.data.xy.AbstractIntervalXYDataset
implements org.jfree.data.xy.IntervalXYDataset, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable
HistogramDataset
,
SimpleHistogramDataset
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
OverwritableHistogramDataset.ColoredDataSeries
A histogram data series associated with a color.
|
Constructor and Description |
---|
OverwritableHistogramDataset()
Creates a new (empty) dataset with a default type of
HistogramType .FREQUENCY. |
Modifier and Type | Method and Description |
---|---|
void |
addSeries(java.lang.String key,
double[] values,
int bins)
Adds a series to the dataset.
|
java.lang.Object |
clone()
Returns a clone of the dataset.
|
boolean |
equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary object.
|
(package private) java.util.List<org.jfree.data.statistics.HistogramBin> |
getBins(int series)
Returns the bins for a series.
|
java.util.Collection<OverwritableHistogramDataset.ColoredDataSeries> |
getDataSeries()
Returns the set of colored data series.
|
java.lang.Number |
getEndX(int series,
int item)
Returns the end value for a bin.
|
java.lang.Number |
getEndY(int series,
int item)
Returns the end y-value for a bin (which is the same as the y-value, this
method exists only to support the general form of the
IntervalXYDataset interface). |
int |
getItemCount(int series)
Returns the number of data items for a series.
|
int |
getSeriesCount()
Returns the number of series in the dataset.
|
java.lang.Comparable<java.lang.String> |
getSeriesKey(int arg0)
A bit expensive...
|
java.lang.Number |
getStartX(int series,
int item)
Returns the start value for a bin.
|
java.lang.Number |
getStartY(int series,
int item)
Returns the start y-value for a bin (which is the same as the y-value,
this method exists only to support the general form of the
IntervalXYDataset interface). |
org.jfree.data.statistics.HistogramType |
getType()
Returns the histogram type.
|
java.lang.Number |
getX(int series,
int item)
Returns the X value for a bin.
|
java.lang.Number |
getY(int series,
int item)
Returns the y-value for a bin (calculated to take into account the
histogram type).
|
int |
hashCode() |
void |
overwriteSeries(java.lang.String key,
double[] values,
int bins)
Add new values to an existing series.
|
void |
resetData(java.util.List<java.lang.String> names,
java.util.List<double[]> data,
int bins)
Reset the data in the data map field.
|
void |
setSeriesColor(java.lang.String seriesName,
java.awt.Color color)
Set the color of a data series.
|
void |
setType(org.jfree.data.statistics.HistogramType type)
Sets the histogram type and sends a
DatasetChangeEvent to all
registered listeners. |
getEndXValue, getEndYValue, getStartXValue, getStartYValue
getDomainOrder, getXValue, getYValue
addChangeListener, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public OverwritableHistogramDataset()
HistogramType
.FREQUENCY.public org.jfree.data.statistics.HistogramType getType()
null
).public void setType(org.jfree.data.statistics.HistogramType type)
DatasetChangeEvent
to all
registered listeners.type
- the type (null
not permitted).public void overwriteSeries(java.lang.String key, double[] values, int bins)
key
- the series key (null
not permitted).values
- the raw observations.bins
- the number of bins (must be at least 1).public void addSeries(java.lang.String key, double[] values, int bins)
key
- the series key (null
not permitted).values
- the raw observations.bins
- the number of bins (must be at least 1).public void resetData(java.util.List<java.lang.String> names, java.util.List<double[]> data, int bins)
names
- List of data series namesdata
- The databins
- number of bins to usepublic java.lang.Comparable<java.lang.String> getSeriesKey(int arg0)
getSeriesKey
in interface org.jfree.data.general.SeriesDataset
getSeriesKey
in class org.jfree.data.general.AbstractSeriesDataset
java.util.List<org.jfree.data.statistics.HistogramBin> getBins(int series)
series
- the series index (in the range 0
to
getSeriesCount() - 1
).java.lang.IndexOutOfBoundsException
- if series
is outside the
specified range.public int getSeriesCount()
getSeriesCount
in interface org.jfree.data.general.SeriesDataset
getSeriesCount
in class org.jfree.data.general.AbstractSeriesDataset
public int getItemCount(int series)
getItemCount
in interface org.jfree.data.xy.XYDataset
series
- the series index (in the range 0
to
getSeriesCount() - 1
).java.lang.IndexOutOfBoundsException
- if series
is outside the
specified range.public java.lang.Number getX(int series, int item)
getX
in interface org.jfree.data.xy.XYDataset
series
- the series index (in the range 0
to
getSeriesCount() - 1
).item
- the item index (zero based).java.lang.IndexOutOfBoundsException
- if series
is outside the
specified range.public java.lang.Number getY(int series, int item)
getY
in interface org.jfree.data.xy.XYDataset
series
- the series index (in the range 0
to
getSeriesCount() - 1
).item
- the item index (zero based).java.lang.IndexOutOfBoundsException
- if series
is outside the
specified range.public java.lang.Number getStartX(int series, int item)
getStartX
in interface org.jfree.data.xy.IntervalXYDataset
series
- the series index (in the range 0
to
getSeriesCount() - 1
).item
- the item index (zero based).java.lang.IndexOutOfBoundsException
- if series
is outside the
specified range.public java.lang.Number getEndX(int series, int item)
getEndX
in interface org.jfree.data.xy.IntervalXYDataset
series
- the series index (in the range 0
to
getSeriesCount() - 1
).item
- the item index (zero based).java.lang.IndexOutOfBoundsException
- if series
is outside the
specified range.public java.lang.Number getStartY(int series, int item)
IntervalXYDataset
interface).getStartY
in interface org.jfree.data.xy.IntervalXYDataset
series
- the series index (in the range 0
to
getSeriesCount() - 1
).item
- the item index (zero based).java.lang.IndexOutOfBoundsException
- if series
is outside the
specified range.public java.lang.Number getEndY(int series, int item)
IntervalXYDataset
interface).getEndY
in interface org.jfree.data.xy.IntervalXYDataset
series
- the series index (in the range 0
to
getSeriesCount() - 1
).item
- the item index (zero based).java.lang.IndexOutOfBoundsException
- if series
is outside the
specified range.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to test against (null
permitted).public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class org.jfree.data.general.AbstractDataset
java.lang.CloneNotSupportedException
- if the object cannot be cloned.public void setSeriesColor(java.lang.String seriesName, java.awt.Color color)
seriesName
- the series namecolor
- the color to setpublic java.util.Collection<OverwritableHistogramDataset.ColoredDataSeries> getDataSeries()