Module org.jfree.chart3d
Package org.jfree.chart3d.data.category
Class StandardCategoryDataset3D<S extends Comparable<S>,R extends Comparable<R>,C extends Comparable<C>>
java.lang.Object
org.jfree.chart3d.data.AbstractDataset3D
org.jfree.chart3d.data.category.StandardCategoryDataset3D<S,R,C>
- All Implemented Interfaces:
Serializable
,CategoryDataset3D<S,
,R, C> Dataset3D
,KeyedValues3D<S,
,R, C, Number> Values3D<Number>
public final class StandardCategoryDataset3D<S extends Comparable<S>,R extends Comparable<R>,C extends Comparable<C>>
extends AbstractDataset3D
implements CategoryDataset3D<S,R,C>, Serializable
A standard implementation of the
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
CategoryDataset3D
interface.
This dataset is typically used to create bar charts and stacked bar charts.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSeriesAsRow
(S seriesKey, KeyedValues<C, ? extends Number> data) Adds a data series as a single row in the dataset.void
addSeriesAsRow
(S seriesKey, R rowKey, KeyedValues<C, ? extends Number> data) Adds a data series as a single row in the dataset.void
Adds a value for a series at the specified cell (referenced by row key and column key).boolean
Tests this instance for equality with an arbitrary object.int
Returns the number of columns in the dataset.int
getColumnIndex
(C columnkey) Returns the index of the specified column key, or-1
if there is no matching key.getColumnKey
(int columnIndex) Returns the key for the specified column.Returns a list of the column keys for the dataset.double
getDoubleValue
(int seriesIndex, int rowIndex, int columnIndex) Returns the value for a series at the specified cell (referenced by row index and column index) as a double primitive.int
Returns the number of rows in the dataset.int
getRowIndex
(R rowkey) Returns the index of the specified row key, or-1
if there is no matching key.getRowKey
(int rowIndex) Returns the key for the specified row.Returns a list of the row keys for the dataset.int
Returns the number of data series in the dataset.int
getSeriesIndex
(S serieskey) Returns the index for the specified series key, or-1
if the key is not defined in the dataset.getSeriesKey
(int seriesIndex) Returns the key for the specified series.Returns a list of the series keys for the dataset.getValue
(int seriesIndex, int rowIndex, int columnIndex) Returns the value for a series at the specified cell (referenced by row index and column index).Returns the value for a series at the specified cell (referenced by row key and column key).void
Sets the value for a series at the specified cell (referenced by row key and column key).toString()
Returns a string representation of this instance, primarily for debugging purposes.Methods inherited from class org.jfree.chart3d.data.AbstractDataset3D
addChangeListener, fireChangeEvent, fireDatasetChanged, hasListener, isNotify, notifyListeners, removeChangeListener, setNotify
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jfree.chart3d.data.Dataset3D
addChangeListener, hasListener, removeChangeListener
-
Constructor Details
-
StandardCategoryDataset3D
public StandardCategoryDataset3D()Creates a new (empty) dataset.
-
-
Method Details
-
getSeriesCount
Returns the number of data series in the dataset.- Specified by:
getSeriesCount
in interfaceValues3D<S extends Comparable<S>>
- Returns:
- The number of data series.
-
getRowCount
Returns the number of rows in the dataset.- Specified by:
getRowCount
in interfaceValues3D<S extends Comparable<S>>
- Returns:
- The number of rows.
-
getColumnCount
Returns the number of columns in the dataset.- Specified by:
getColumnCount
in interfaceValues3D<S extends Comparable<S>>
- Returns:
- The number of columns.
-
getSeriesKey
Returns the key for the specified series.- Specified by:
getSeriesKey
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
seriesIndex
- the series index.- Returns:
- The series key.
-
getRowKey
Returns the key for the specified row.- Specified by:
getRowKey
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
rowIndex
- The row index.- Returns:
- The row key.
-
getColumnKey
Returns the key for the specified column.- Specified by:
getColumnKey
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
columnIndex
- the column index.- Returns:
- The column key.
-
getSeriesIndex
Returns the index for the specified series key, or-1
if the key is not defined in the dataset.- Specified by:
getSeriesIndex
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
serieskey
- the series key (null
not permitted).- Returns:
- The series index or
-1
.
-
getRowIndex
Returns the index of the specified row key, or-1
if there is no matching key.- Specified by:
getRowIndex
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
rowkey
- the row key (null
not permitted).- Returns:
- The row index or
-1
.
-
getColumnIndex
Returns the index of the specified column key, or-1
if there is no matching key.- Specified by:
getColumnIndex
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
columnkey
- the column key (null
not permitted).- Returns:
- The column index or
-1
.
-
getSeriesKeys
Returns a list of the series keys for the dataset. Modifying this list will have no impact on the underlying dataset.- Specified by:
getSeriesKeys
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Returns:
- A list of the series keys (possibly empty, but never
null
).
-
getRowKeys
Returns a list of the row keys for the dataset. Modifying this list will have no impact on the underlying dataset.- Specified by:
getRowKeys
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Returns:
- A list of the row keys (possibly empty, but never
null
).
-
getColumnKeys
Returns a list of the column keys for the dataset. Modifying this list will have no impact on the underlying dataset.- Specified by:
getColumnKeys
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Returns:
- A list of the column keys (possibly empty, but never
null
).
-
getValue
Returns the value for a series at the specified cell (referenced by row key and column key).- Specified by:
getValue
in interfaceKeyedValues3D<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
seriesKey
- the series key (null
not permitted).rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).- Returns:
- The value (possibly
null
).
-
getValue
Returns the value for a series at the specified cell (referenced by row index and column index).- Specified by:
getValue
in interfaceValues3D<S extends Comparable<S>>
- Parameters:
seriesIndex
- the series index.rowIndex
- the row index.columnIndex
- the column index.- Returns:
- The value (possibly
null
).
-
setValue
Sets the value for a series at the specified cell (referenced by row key and column key).- Parameters:
n
- the value (null
permitted).seriesKey
- the series key (null
not permitted).rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).
-
addValue
Adds a value for a series at the specified cell (referenced by row key and column key). This method simply callssetValue(java.lang.Number, java.lang.Comparable, java.lang.Comparable, java.lang.Comparable)
.- Parameters:
n
- the value (null
permitted).seriesKey
- the series key (null
not permitted).rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).
-
getDoubleValue
Returns the value for a series at the specified cell (referenced by row index and column index) as a double primitive. If the stored data value isnull
, this method returnsDouble.NaN
.- Specified by:
getDoubleValue
in interfaceValues3D<S extends Comparable<S>>
- Parameters:
seriesIndex
- the series index.rowIndex
- the row index.columnIndex
- the column index.- Returns:
- The value (possibly
Double.NaN
).
-
addSeriesAsRow
Adds a data series as a single row in the dataset.- Parameters:
seriesKey
- the series key (null
not permitted).data
- the data (null
not permitted).
-
addSeriesAsRow
Adds a data series as a single row in the dataset.- Parameters:
seriesKey
- the series key (null
not permitted).rowKey
- the row key (null
not permitted).data
- the data (null
not permitted).
-
equals
Tests this instance for equality with an arbitrary object. -
toString
Returns a string representation of this instance, primarily for debugging purposes.
Implementation note: the current implementation (which is subject to change) writes the dataset in JSON format usingJSONUtils.writeKeyedValues3D(org.jfree.chart3d.data.KeyedValues3D)
.
-