de.erichseifert.gral.data
Class Row
- java.lang.Object
-
- de.erichseifert.gral.data.DataAccessor
-
- de.erichseifert.gral.data.Row
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable<java.lang.Comparable<?>>
public class Row extends DataAccessor
Class for easily accessing a row of a data source.
Example:
Row row = new Row(data, 2); Number value = row.get(3);
- See Also:
DataSource, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Row(DataSource source, int row)Initializes a new instances with the specified data source and row index.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Comparable<?>get(int col)Returns the value of the data source for the specified index.booleanisColumnNumeric(int columnIndex)Returns whether the column at the specified index contains numbers.intsize()Returns the number of elements in this column.-
Methods inherited from class de.erichseifert.gral.data.DataAccessor
equals, getIndex, getSource, getStatistics, hashCode, iterator, toArray, toString
-
-
-
-
Constructor Detail
-
Row
public Row(DataSource source, int row)
Initializes a new instances with the specified data source and row index.- Parameters:
source- Data source.row- Row index.
-
-
Method Detail
-
get
public java.lang.Comparable<?> get(int col)
Description copied from class:DataAccessorReturns the value of the data source for the specified index.- Specified by:
getin classDataAccessor- Parameters:
col- Index.- Returns:
- Value of the accessed cell.
-
size
public int size()
Description copied from class:DataAccessorReturns the number of elements in this column.- Specified by:
sizein classDataAccessor- Returns:
- Number of elements
-
isColumnNumeric
public 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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG