Documentation of 'de.erichseifert.gral.data.EnumeratedData' Java class
EnumeratedData
de.erichseifert.gral.data

Class EnumeratedData

  • All Implemented Interfaces:
    DataListener, DataSource, java.io.Serializable, java.lang.Iterable<java.lang.Comparable<?>>


    public class EnumeratedData
    extends AbstractDataSource
    implements DataListener

    Class that creates a new data source which adds a leading column containing the row number.

    Example which creates a two column data source from a one column histogram:

     DataSource hist = new Histogram2D(data, Orientation.HORIZONTAL, 10);
     DataSource hist2d = new EnumeratedData(hist);
     
    See Also:
    DataSource, Serialized Form
    • Constructor Detail

      • EnumeratedData

        public EnumeratedData(DataSource original,
                              double offset,
                              double steps)
        Initializes a new data source based on an original data source which will contain an additional column which enumerates all rows. The enumeration will start at a specified offset and will have a specified step size.
        Parameters:
        original - Original data source.
        offset - Offset of enumeration
        steps - Scaling of enumeration
      • EnumeratedData

        public EnumeratedData(DataSource original)
        Initializes a new data source based on an original data source which will contain an additional column which enumerates all rows.
        Parameters:
        original - Original data source.
    • 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 added. 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.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.