de.erichseifert.gral.data
Class DummyData
- java.lang.Object
-
- de.erichseifert.gral.data.AbstractDataSource
-
- de.erichseifert.gral.data.DummyData
-
- All Implemented Interfaces:
- DataSource, java.io.Serializable, java.lang.Iterable<java.lang.Comparable<?>>
public class DummyData extends AbstractDataSource
Class that represents a data source containing the same value in each cell. It can be used for test purposes or for efficiently creating constant data.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DummyData(int cols, int rows, java.lang.Comparable<?> value)Creates a new instance with the specified number of columns and rows, which are filled all over with the same specified value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Comparable<?>get(int col, int row)Returns the row with the specified index.intgetColumnCount()Returns the number of columns of the data source.intgetRowCount()Returns the number of rows of the data source.-
Methods inherited from class de.erichseifert.gral.data.AbstractDataSource
addDataListener, getColumn, getColumnStatistics, getColumnTypes, getName, getRecord, getRow, getRowStatistics, getStatistics, isColumnNumeric, iterator, removeDataListener
-
-
-
-
Constructor Detail
-
DummyData
public DummyData(int cols, int rows, java.lang.Comparable<?> value)Creates a new instance with the specified number of columns and rows, which are filled all over with the same specified value.- Parameters:
cols- Number of columns.rows- Number of rows.value- Value of the cells.
-
-
Method Detail
-
get
public java.lang.Comparable<?> get(int col, int row)Returns the row with the specified index.- Parameters:
col- index of the column to returnrow- index of the row to return- Returns:
- the specified value of the data cell
-
getColumnCount
public int getColumnCount()
Description copied from class:AbstractDataSourceReturns the number of columns of the data source.- Specified by:
getColumnCountin interfaceDataSource- Overrides:
getColumnCountin classAbstractDataSource- Returns:
- number of columns in the data source.
-
getRowCount
public int getRowCount()
Returns the number of rows of the data source.- Returns:
- number of rows in the data source.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG