All Known Implementing Classes:
AbstractFilter, CustomDateFilter, DayFilter, DiscreteFilter, MonthFilter, ShiftFilter, StringFilter, YearFilter

public interface Filter
A Filter is used by the row selector panel. A filter is used to classify a row. For instance, A Month filter might classify a row as January, Febuary, etc. These classifications will then be used to show what data exists to a user, who can choose just one classification to filter the data.
  • Method Summary

    Modifier and Type
    Method
    Description
    classify(Dataset data, int row)
    Returns a classification key for the given row in the dataset.
    Creates a copy of this filter.
    Returns the name of the column that this filter looks at
    int
    Given an evenly distributed dataset, how many different classification keys should be expected from this Filter? For instance, a Month filter would return 12, a Day-of-week filter would return 7, while a Year filter would simply return some guess.
     
    void
    Called when the dataset being passed to classify has changed.
    boolean
     
    void
    Sets the column that the filter looks at
    void
     
    void
    setReverseSort(boolean isReverseSort)
     
  • Method Details

    • classify

      Comparable classify(Dataset data, int row)
      Returns a classification key for the given row in the dataset. If the row can't be classified for some reason, like the classification column not exsiting, null should be returned.
    • invalidateCache

      void invalidateCache()
      Called when the dataset being passed to classify has changed. This is used for Filters who do some work up front on the DataSet the first time classify is called, such as calculating the column index that they are working on.
    • getDistributionEstimate

      int getDistributionEstimate()
      Given an evenly distributed dataset, how many different classification keys should be expected from this Filter? For instance, a Month filter would return 12, a Day-of-week filter would return 7, while a Year filter would simply return some guess. This isn't critical, it is used to try and give arrays reasonable initial sizes so they don't have to re-allocate frequently.
    • copyFilter

      Filter copyFilter()
      Creates a copy of this filter. Used for the customizer
    • getColumnName

      String getColumnName()
      Returns the name of the column that this filter looks at
    • setColumnName

      void setColumnName(String s)
      Sets the column that the filter looks at
    • getIconPath

      String getIconPath()
    • setIconPath

      void setIconPath(String path)
    • isReverseSort

      boolean isReverseSort()
    • setReverseSort

      void setReverseSort(boolean isReverseSort)