de.erichseifert.gral.data
Interface DataSource
-
- All Superinterfaces:
- java.lang.Iterable<java.lang.Comparable<?>>
- All Known Subinterfaces:
- MutableDataSource
- All Known Implementing Classes:
- AbstractDataSource, AbstractHistogram2D, Convolution, DataSeries, DataTable, DummyData, EnumeratedData, Filter2D, Histogram2D, JdbcData, Median, Resize, RowSubset
public interface DataSource extends java.lang.Iterable<java.lang.Comparable<?>>Interface for an immutable access to tabular data.- See Also:
MutableDataSource
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddDataListener(DataListener dataListener)Adds the specifiedDataListenerto this data source.java.lang.Comparable<?>get(int col, int row)Returns the value with the specified row and column index.Column<?>getColumn(int col)Returns the column with the specified index.intgetColumnCount()Returns the number of columns of the data source.DataSourcegetColumnStatistics(java.lang.String key)java.lang.Class<? extends java.lang.Comparable<?>>[]getColumnTypes()Returns the data types of all columns.java.lang.StringgetName()Returns the name of this series.RecordgetRecord(int row)RowgetRow(int row)Returns the row with the specified index.intgetRowCount()Returns the number of rows of the data source.DataSourcegetRowStatistics(java.lang.String key)StatisticsgetStatistics()Retrieves a object instance that contains various statistical information on the current data source.booleanisColumnNumeric(int columnIndex)Returns whether the column at the specified index contains numbers.voidremoveDataListener(DataListener dataListener)Removes the specifiedDataListenerfrom this data source.
-
-
-
Method Detail
-
getColumn
Column<?> getColumn(int col)
Returns the column with the specified index.- Parameters:
col- index of the column to return- Returns:
- the specified column of the data source
-
getColumnTypes
java.lang.Class<? extends java.lang.Comparable<?>>[] getColumnTypes()
Returns the data types of all columns.- Returns:
- The data types of all column in the data source
-
getRow
Row getRow(int row)
Returns the row with the specified index.- Parameters:
row- index of the row to return- Returns:
- the specified row of the data source
-
get
java.lang.Comparable<?> get(int col, int row)Returns the value with the specified row and column index.- Parameters:
col- index of the column to returnrow- index of the row to return- Returns:
- the specified value of the data cell
-
getStatistics
Statistics getStatistics()
Retrieves a object instance that contains various statistical information on the current data source.- Returns:
- statistical information
-
getColumnStatistics
DataSource getColumnStatistics(java.lang.String key)
-
getRowStatistics
DataSource getRowStatistics(java.lang.String key)
-
getRowCount
int getRowCount()
Returns the number of rows of the data source.- Returns:
- number of rows in the data source.
-
getName
java.lang.String getName()
Returns the name of this series.- Returns:
- a name string
-
getColumnCount
int getColumnCount()
Returns the number of columns of the data source.- Returns:
- number of columns in the data source.
-
isColumnNumeric
boolean isColumnNumeric(int columnIndex)
Returns whether the column at the specified index contains numbers.- Parameters:
columnIndex- Index of the column to test.- Returns:
trueif the column is numeric, otherwisefalse.
-
addDataListener
void addDataListener(DataListener dataListener)
Adds the specifiedDataListenerto this data source.- Parameters:
dataListener- listener to be added.
-
removeDataListener
void removeDataListener(DataListener dataListener)
Removes the specifiedDataListenerfrom this data source.- Parameters:
dataListener- listener to be removed.
-
getRecord
Record getRecord(int row)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG