com.orsoncharts.data.category

## Class StandardCategoryDataset3D

- java.lang.Object
- - com.orsoncharts.data.AbstractDataset3D
  - - com.orsoncharts.data.category.StandardCategoryDataset3D

- All Implemented Interfaces:
    CategoryDataset3D, Dataset3D, KeyedValues3D<java.lang.Number>, Values3D<java.lang.Number>, java.io.Serializable

      public final class StandardCategoryDataset3D
      extends AbstractDataset3D
      implements CategoryDataset3D, java.io.Serializable

  A standard implementation of the `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:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardCategoryDataset3D()` Creates a new (empty) dataset.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSeriesAsRow(java.lang.Comparable<?> seriesKey, java.lang.Comparable<?> rowKey, KeyedValues<? extends java.lang.Number> data)` Adds a data series as a single row in the dataset.
    `void` | `addSeriesAsRow(java.lang.Comparable<?> seriesKey, KeyedValues<? extends java.lang.Number> data)` Adds a data series as a single row in the dataset.
    `void` | `addValue(java.lang.Number n, java.lang.Comparable<?> seriesKey, java.lang.Comparable<?> rowKey, java.lang.Comparable<?> columnKey)` Adds a value for a series at the specified cell (referenced by row key and column key).
    `boolean` | `equals(java.lang.Object obj)` Tests this instance for equality with an arbitrary object.
    `int` | `getColumnCount()` Returns the number of columns in the dataset.
    `int` | `getColumnIndex(java.lang.Comparable<?> columnkey)` Returns the index of the specified column key, or `-1` if there is no matching key.
    `java.lang.Comparable<?>` | `getColumnKey(int columnIndex)` Returns the key for the specified column.
    `java.util.List<java.lang.Comparable<?>>` | `getColumnKeys()` 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` | `getRowCount()` Returns the number of rows in the dataset.
    `int` | `getRowIndex(java.lang.Comparable<?> rowkey)` Returns the index of the specified row key, or `-1` if there is no matching key.
    `java.lang.Comparable<?>` | `getRowKey(int rowIndex)` Returns the key for the specified row.
    `java.util.List<java.lang.Comparable<?>>` | `getRowKeys()` Returns a list of the row keys for the dataset.
    `int` | `getSeriesCount()` Returns the number of data series in the dataset.
    `int` | `getSeriesIndex(java.lang.Comparable<?> serieskey)` Returns the index for the specified series key, or `-1` if the key is not defined in the dataset.
    `java.lang.Comparable<?>` | `getSeriesKey(int seriesIndex)` Returns the key for the specified series.
    `java.util.List<java.lang.Comparable<?>>` | `getSeriesKeys()` Returns a list of the series keys for the dataset.
    `java.lang.Number` | `getValue(java.lang.Comparable<?> seriesKey, java.lang.Comparable<?> rowKey, java.lang.Comparable<?> columnKey)` Returns the value for a series at the specified cell (referenced by row key and column key).
    `java.lang.Number` | `getValue(int seriesIndex, int rowIndex, int columnIndex)` Returns the value for a series at the specified cell (referenced by row index and column index).
    `void` | `setValue(java.lang.Number n, java.lang.Comparable<?> seriesKey, java.lang.Comparable<?> rowKey, java.lang.Comparable<?> columnKey)` Sets the value for a series at the specified cell (referenced by row key and column key).
    `java.lang.String` | `toString()` Returns a string representation of this instance, primarily for debugging purposes.

    - ### Methods inherited from class com.orsoncharts.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 com.orsoncharts.data.Dataset3D

      `addChangeListener, hasListener, removeChangeListener`

- - ### Constructor Detail

    - #### StandardCategoryDataset3D

          public StandardCategoryDataset3D()

      Creates a new (empty) dataset.

  - ### Method Detail

    - #### getSeriesCount

          public int getSeriesCount()

      Returns the number of data series in the dataset.
      Specified by:
        `getSeriesCount` in interface `Values3D<java.lang.Number>`
      Returns:
        The number of data series.

    - #### getRowCount

          public int getRowCount()

      Returns the number of rows in the dataset.
      Specified by:
        `getRowCount` in interface `Values3D<java.lang.Number>`
      Returns:
        The number of rows.

    - #### getColumnCount

          public int getColumnCount()

      Returns the number of columns in the dataset.
      Specified by:
        `getColumnCount` in interface `Values3D<java.lang.Number>`
      Returns:
        The number of columns.

    - #### getSeriesKey

          public java.lang.Comparable<?> getSeriesKey(int seriesIndex)

      Returns the key for the specified series.
      Specified by:
        `getSeriesKey` in interface `KeyedValues3D<java.lang.Number>`
      Parameters:
        `seriesIndex` - the series index.
      Returns:
        The series key.

    - #### getRowKey

          public java.lang.Comparable<?> getRowKey(int rowIndex)

      Returns the key for the specified row.
      Specified by:
        `getRowKey` in interface `KeyedValues3D<java.lang.Number>`
      Parameters:
        `rowIndex` - The row index.
      Returns:
        The row key.

    - #### getColumnKey

          public java.lang.Comparable<?> getColumnKey(int columnIndex)

      Returns the key for the specified column.
      Specified by:
        `getColumnKey` in interface `KeyedValues3D<java.lang.Number>`
      Parameters:
        `columnIndex` - the column index.
      Returns:
        The column key.

    - #### getSeriesIndex

          public int getSeriesIndex(java.lang.Comparable<?> serieskey)

      Returns the index for the specified series key, or `-1` if the key is not defined in the dataset.
      Specified by:
        `getSeriesIndex` in interface `KeyedValues3D<java.lang.Number>`
      Parameters:
        `serieskey` - the series key (`null` not permitted).
      Returns:
        The series index or `-1`.

    - #### getRowIndex

          public int getRowIndex(java.lang.Comparable<?> rowkey)

      Returns the index of the specified row key, or `-1` if there is no matching key.
      Specified by:
        `getRowIndex` in interface `KeyedValues3D<java.lang.Number>`
      Parameters:
        `rowkey` - the row key (`null` not permitted).
      Returns:
        The row index or `-1`.

    - #### getColumnIndex

          public int getColumnIndex(java.lang.Comparable<?> columnkey)

      Returns the index of the specified column key, or `-1` if there is no matching key.
      Specified by:
        `getColumnIndex` in interface `KeyedValues3D<java.lang.Number>`
      Parameters:
        `columnkey` - the column key (`null` not permitted).
      Returns:
        The column index or `-1`.

    - #### getSeriesKeys

          public java.util.List<java.lang.Comparable<?>> 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 interface `KeyedValues3D<java.lang.Number>`
      Returns:
        A list of the series keys (possibly empty, but never `null`).

    - #### getRowKeys

          public java.util.List<java.lang.Comparable<?>> 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 interface `KeyedValues3D<java.lang.Number>`
      Returns:
        A list of the row keys (possibly empty, but never `null`).

    - #### getColumnKeys

          public java.util.List<java.lang.Comparable<?>> 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 interface `KeyedValues3D<java.lang.Number>`
      Returns:
        A list of the column keys (possibly empty, but never `null`).

    - #### getValue

          public java.lang.Number getValue(java.lang.Comparable<?> seriesKey,
                                           java.lang.Comparable<?> rowKey,
                                           java.lang.Comparable<?> columnKey)

      Returns the value for a series at the specified cell (referenced by row key and column key).
      Specified by:
        `getValue` in interface `KeyedValues3D<java.lang.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

          public java.lang.Number getValue(int seriesIndex,
                                           int rowIndex,
                                           int columnIndex)

      Returns the value for a series at the specified cell (referenced by row index and column index).
      Specified by:
        `getValue` in interface `Values3D<java.lang.Number>`
      Parameters:
        `seriesIndex` - the series index.
        `rowIndex` - the row index.
        `columnIndex` - the column index.
      Returns:
        The value (possibly `null`).

    - #### setValue

          public void setValue(java.lang.Number n,
                               java.lang.Comparable<?> seriesKey,
                               java.lang.Comparable<?> rowKey,
                               java.lang.Comparable<?> columnKey)

      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

          public void addValue(java.lang.Number n,
                               java.lang.Comparable<?> seriesKey,
                               java.lang.Comparable<?> rowKey,
                               java.lang.Comparable<?> columnKey)

      Adds a value for a series at the specified cell (referenced by row key and column key). This method simply calls `setValue( 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

          public 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. If the stored data value is `null`, this method returns `Double.NaN`.
      Specified by:
        `getDoubleValue` in interface `Values3D<java.lang.Number>`
      Parameters:
        `seriesIndex` - the series index.
        `rowIndex` - the row index.
        `columnIndex` - the column index.
      Returns:
        The value (possibly `Double.NaN`).

    - #### addSeriesAsRow

          public void addSeriesAsRow(java.lang.Comparable<?> seriesKey,
                                     KeyedValues<? extends java.lang.Number> data)

      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

          public void addSeriesAsRow(java.lang.Comparable<?> seriesKey,
                                     java.lang.Comparable<?> rowKey,
                                     KeyedValues<? extends java.lang.Number> data)

      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

          public boolean equals(java.lang.Object obj)

      Tests this instance for equality with an arbitrary object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the object to test against (`null` permitted).
      Returns:
        A boolean.

    - #### toString

          public java.lang.String 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 using `JSONUtils.writeKeyedValues3D(com.orsoncharts.data.KeyedValues3D)`.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A string.