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 TypeMethodDescriptionvoidaddSeriesAsRow(S seriesKey, KeyedValues<C, ? extends Number> data) Adds a data series as a single row in the dataset.voidaddSeriesAsRow(S seriesKey, R rowKey, KeyedValues<C, ? extends Number> data) Adds a data series as a single row in the dataset.voidAdds a value for a series at the specified cell (referenced by row key and column key).booleanTests this instance for equality with an arbitrary object.intReturns the number of columns in the dataset.intgetColumnIndex(C columnkey) Returns the index of the specified column key, or-1if 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.doublegetDoubleValue(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.intReturns the number of rows in the dataset.intgetRowIndex(R rowkey) Returns the index of the specified row key, or-1if 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.intReturns the number of data series in the dataset.intgetSeriesIndex(S serieskey) Returns the index for the specified series key, or-1if 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).voidSets 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, setNotifyMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
getSeriesCountin interfaceValues3D<S extends Comparable<S>>- Returns:
- The number of data series.
-
getRowCount
Returns the number of rows in the dataset.- Specified by:
getRowCountin interfaceValues3D<S extends Comparable<S>>- Returns:
- The number of rows.
-
getColumnCount
Returns the number of columns in the dataset.- Specified by:
getColumnCountin interfaceValues3D<S extends Comparable<S>>- Returns:
- The number of columns.
-
getSeriesKey
Returns the key for the specified series.- Specified by:
getSeriesKeyin 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:
getRowKeyin 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:
getColumnKeyin 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-1if the key is not defined in the dataset.- Specified by:
getSeriesIndexin interfaceKeyedValues3D<S extends Comparable<S>,R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
serieskey- the series key (nullnot permitted).- Returns:
- The series index or
-1.
-
getRowIndex
Returns the index of the specified row key, or-1if there is no matching key.- Specified by:
getRowIndexin interfaceKeyedValues3D<S extends Comparable<S>,R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
rowkey- the row key (nullnot permitted).- Returns:
- The row index or
-1.
-
getColumnIndex
Returns the index of the specified column key, or-1if there is no matching key.- Specified by:
getColumnIndexin interfaceKeyedValues3D<S extends Comparable<S>,R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
columnkey- the column key (nullnot 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:
getSeriesKeysin 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:
getRowKeysin 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:
getColumnKeysin 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:
getValuein interfaceKeyedValues3D<S extends Comparable<S>,R extends Comparable<R>, C extends Comparable<C>, Number> - Parameters:
seriesKey- the series key (nullnot permitted).rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot 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:
getValuein 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 (nullpermitted).seriesKey- the series key (nullnot permitted).rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot 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 (nullpermitted).seriesKey- the series key (nullnot permitted).rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot 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:
getDoubleValuein 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 (nullnot permitted).data- the data (nullnot permitted).
-
addSeriesAsRow
Adds a data series as a single row in the dataset.- Parameters:
seriesKey- the series key (nullnot permitted).rowKey- the row key (nullnot permitted).data- the data (nullnot 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).
-