de.erichseifert.gral.data
Class RowSubset

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

public abstract class RowSubset
extends AbstractDataSource
implements DataListener

Abstract class that represents a view on several rows of a data source.


Constructor Summary
RowSubset(DataSource original)
          Creates a new instance with the specified data source
 
Method Summary
abstract  boolean accept(Row row)
          Tests whether the specified row is accepted by this DataSubset or not.
 void dataChanged(DataSource data)
          Method that is invoked by objects that provide support for DataListeners.
 Number get(int col, int row)
          Returns the row with the specified index.
 int getColumnCount()
          Returns the number of columns of the data source.
 Row getRow(int row)
          Returns the row with the specified index.
 int getRowCount()
          Returns the number of rows of the data source.
 
Methods inherited from class de.erichseifert.gral.data.AbstractDataSource
addDataListener, getColumn, getStatistics, iterator, removeDataListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowSubset

public RowSubset(DataSource original)
Creates a new instance with the specified data source

Parameters:
original - DataSource to be filtered.
Method Detail

getRow

public Row getRow(int row)
Description copied from interface: DataSource
Returns the row with the specified index.

Specified by:
getRow in interface DataSource
Overrides:
getRow in class AbstractDataSource
Parameters:
row - index of the row to return
Returns:
the specified row of the data source

get

public Number get(int col,
                  int row)
Description copied from interface: DataSource
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

getColumnCount

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

Specified by:
getColumnCount in interface DataSource
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.

Specified by:
getRowCount in interface DataSource
Returns:
number of rows in the data source.

dataChanged

public void dataChanged(DataSource data)
Description copied from interface: DataListener
Method that is invoked by objects that provide support for DataListeners.

Specified by:
dataChanged in interface DataListener
Parameters:
data - data that has changed

accept

public abstract boolean accept(Row row)
Tests whether the specified row is accepted by this DataSubset or not.

Parameters:
row - Row to be tested.
Returns:
True if the row should be kept.


Copyright © 2009-2010. All Rights Reserved.