de.erichseifert.gral.data
Class EnumeratedData

java.lang.Object
  extended by de.erichseifert.gral.data.AbstractDataSource
      extended by de.erichseifert.gral.data.EnumeratedData
All Implemented Interfaces:
DataSource, Iterable<Number>

public class EnumeratedData
extends AbstractDataSource

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


Constructor Summary
EnumeratedData(DataSource original)
          Initializes a new data source with an original data source.
 
Method Summary
 Number get(int col, int row)
          Returns the row with the specified index.
 int getColumnCount()
          Returns the number of columns of the data source.
 int getRowCount()
          Returns the number of rows of the data source.
 
Methods inherited from class de.erichseifert.gral.data.AbstractDataSource
addDataListener, getColumn, getRow, getStatistics, iterator, removeDataListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumeratedData

public EnumeratedData(DataSource original)
Initializes a new data source with an original data source.

Parameters:
original - Original data source.
Method Detail

get

public Number get(int col,
                  int row)
Description copied from interface: DataSource
Returns the row with the specified index.

Parameters:
col - index of the column to return
row - index of the row to return
Returns:
the specified value of the data cell

getColumnCount

public int getColumnCount()
Description copied from interface: DataSource
Returns the number of columns of the data source.

Returns:
number of columns in the data source.

getRowCount

public int getRowCount()
Description copied from interface: DataSource
Returns the number of rows of the data source.

Returns:
number of rows in the data source.


Copyright © 2009-2010. All Rights Reserved.