Class CategoryDataSeriesKernel

java.lang.Object
com.illumon.iris.db.plot.datasets.category.CategoryDataSeriesKernel

public class CategoryDataSeriesKernel extends Object
The core of the Category data series update and indexing. This is used by the regular category data series to both update the values of existing categories as well as to ensure that new categories are maintained in order of the original table. Note that when the cat plot has multiple series, things are more complicated and overall ordering is managed by the CategoryIndex
  • Constructor Details

    • CategoryDataSeriesKernel

      public CategoryDataSeriesKernel(@NotNull String categoryCol, @NotNull String valueColumn, @NotNull PlotInfo plotInfo)
      Create a standard update kernel for a Category series.
      Parameters:
      categoryCol - The name of the column containing the categories.
      valueColumn - The name of the column containing the values
      plotInfo - The PlotInfo object for logging
  • Method Details

    • initMinMax

      public void initMinMax()
      Reinitialize the min and max values to Nan in preparation for reinitialization
    • initListeners

      public void initListeners(@NotNull Table baseTable, @NotNull String listenerDescription, @NotNull PlotInfo plotInfo)
      Initialize the update listener and attach it to the specified base table.
      Parameters:
      baseTable - The table to listen to
      listenerDescription - A description to include with the listener for the PEL
      plotInfo - the PlotInfo for logging and error reporting
    • close

      public void close()
      Detach any attached listeners, clear out any computed data and place the object into a state into which it can be reinitialized.
    • size

      public int size()
      Get the size of the dataset (the number of categories)
      Returns:
      the number of categories in the dataset.
    • categories

      public Collection<Comparable> categories()
      Get an ordered list of the categories in the data.
      Returns:
      the ordered categories of the data
    • getValue

      @Nullable public Number getValue(Comparable<?> category)
      Get the value of the specified category, or null if there was none.
      Parameters:
      category - The category to get the value of
      Returns:
      the value of the specified category
    • getCategoryKey

      public long getCategoryKey(Comparable<?> category)
      Get the index key of the category within the original dataset. This can be used to enforce a global ordering of a MultiSeries cat plot.
      Parameters:
      category - The category to locate.
      Returns:
      the key of the specified category within the original data set. or -1 if not present.
    • getYRange

      @NotNull public org.jfree.data.Range getYRange()
      Get the range of the dataset.