Class CategoryDataSeriesMap

All Implemented Interfaces:
CategoryDataSeries, CategoryDataSeriesInternal, DataSeries, DataSeriesInternal, PlotExceptionCause, Series, SeriesInternal, Serializable

public class CategoryDataSeriesMap extends AbstractMapBasedCategoryDataSeries
A dataset for categorical data which maps a category to it's numerical value.

The number of categories and the number of values must be the same. Does not support repeat categories.

See Also:
  • Constructor Details

    • CategoryDataSeriesMap

      public CategoryDataSeriesMap(AxesImpl axes, int id, Comparable<?> name, IndexableData<T> categories, IndexableNumericData values)
      Creates an instance of CategoryDataSeriesMap, which maps a category to it's numerical value.

      The number of categories and the number of values must be the same. Does not support null or repeat categories.

      Type Parameters:
      T - type of the categorical data
      Parameters:
      axes - AxesImpl on which this dataset is being plotted
      id - data series id
      name - series name
      categories - categorical data
      values - numerical data
      Throws:
      IllegalArgumentException - categories and values must not be null categories and values must have equal sizes
      UnsupportedOperationException - categories must not contain null values categories must not contain repeat values
    • CategoryDataSeriesMap

      public CategoryDataSeriesMap(AxesImpl axes, int id, Comparable<?> name, IndexableData<T> categories, IndexableNumericData values, AbstractCategoryDataSeries series)
  • Method Details

    • copy

      public CategoryDataSeriesMap copy(AxesImpl axes)
      Description copied from interface: SeriesInternal
      Create a copy of the series on a different set of axes.
      Parameters:
      axes - new axes.
      Returns:
      copy of the series on a different set of axes.
    • size

      public int size()
      Description copied from interface: DataSeriesInternal
      Gets the size of this data set.
      Returns:
      size of this data set
    • categories

      public Collection<Comparable> categories()
      Description copied from interface: CategoryDataSeriesInternal
      Gets the categories of the dataset.
      Returns:
      all categories in the dataset
    • getValue

      public Number getValue(Comparable category)
      Description copied from interface: CategoryDataSeriesInternal
      Gets the numeric value corresponding to the given category.
      Parameters:
      category - category
      Returns:
      numeric value corresponding to the given category
    • getCategoryLocation

      public long getCategoryLocation(Comparable category)
      Description copied from interface: CategoryDataSeriesInternal
      Get the row key of the specified series.
      Returns: