Documentation of 'de.erichseifert.gral.data.filters.Filter2D' Java class
Filter2D
de.erichseifert.gral.data.filters

Class Filter2D

  • All Implemented Interfaces:
    DataListener, DataSource, java.io.Serializable, java.lang.Iterable<java.lang.Comparable<?>>
    Direct Known Subclasses:
    Convolution, Median, Resize


    public abstract class Filter2D
    extends AbstractDataSource
    implements DataListener

    Abstract class that provides basic functions for filtering arbitrary columns of a DataSource, in other words a set of one-dimensional data.

    Functionality includes:

    • Different modes for filtering (see Filter2D.Mode)
    • Support for listening for changes of the original data
    • Filtering of multiple columns

    Values of filtered columns are buffered. Access to unfiltered columns is delegated to the original data source. Derived classes must make sure the caches are updated when deserialization is done. This can be done by calling dataUpdated(this) in a custom deserialization method.

    See Also:
    Serialized Form
    • Constructor Detail

      • Filter2D

        public Filter2D(DataSource original,
                        Filter2D.Mode mode,
                        int... cols)
        Initializes a new instance with the specified data source, border handling and columns to be filtered. The columns must be numeric, otherwise an IllegalArgumentException is thrown.
        Parameters:
        original - Data source to be filtered.
        mode - Border handling mode to be used.
        cols - Indexes of numeric columns to be filtered.
    • Method Detail

      • get

        public java.lang.Comparable<?> get(int col,
                                           int row)
        Returns the row with the specified index.
        Specified by:
        get in interface DataSource
        Parameters:
        col - index of the column to return
        row - index of the row to return
        Returns:
        the specified value of the data cell
      • getRowCount

        public int getRowCount()
        Returns the number of rows of the data source.
        Specified by:
        getRowCount in interface DataSource
        Returns:
        number of rows in the data source.
      • dataAdded

        public void dataAdded(DataSource source,
                              DataChangeEvent... events)
        Method that is invoked when data has been added. This method is invoked by objects that provide support for DataListeners and should not be called manually.
        Specified by:
        dataAdded in interface DataListener
        Parameters:
        source - Data source that has been changed.
        events - Optional event object describing the data values that have been added.
      • dataUpdated

        public void dataUpdated(DataSource source,
                                DataChangeEvent... events)
        Method that is invoked when data has been updated. This method is invoked by objects that provide support for DataListeners and should not be called manually.
        Specified by:
        dataUpdated in interface DataListener
        Parameters:
        source - Data source that has been changed
        events - Optional event object describing the data values that have been updated.
      • dataRemoved

        public void dataRemoved(DataSource source,
                                DataChangeEvent... events)
        Method that is invoked when data has been removed. This method is invoked by objects that provide support for DataListeners and should not be called manually.
        Specified by:
        dataRemoved in interface DataListener
        Parameters:
        source - Data source that has been changed
        events - Optional event object describing the data values that have been removed.
      • getMode

        public Filter2D.Mode getMode()
        Returns the Mode of this Filter2D.
        Returns:
        Mode of filtering.
      • setMode

        public void setMode(Filter2D.Mode mode)
        Sets the Mode the specified value.
        Parameters:
        mode - Mode of filtering.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.