Klasse Row
java.lang.Object
de.erichseifert.gral.data.DataAccessor
de.erichseifert.gral.data.Row
- Alle implementierten Schnittstellen:
Serializable, Iterable<Comparable<?>>
A live view of one row of a data source. Reading from it reads through to
the source, so a row reflects later changes to the data — in contrast
to Record, which is a snapshot, and to Column, which copies
its values.
Row row = data.getRow(2); Comparable<?> value = row.get(3); // column 3 of row 2 int columns = row.size();
Because the row keeps only the source and an index, it does not notice
when rows are inserted or removed before it: it then refers to whatever row
now sits at that index. Nothing checks that the index is still valid, so a
row that outlives the data it points into will return null or throw
when read.
- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungRow(DataSource source, int row) Initializes a new view on the specified row of a data source. -
Methodenübersicht
Modifikator und TypMethodeBeschreibungComparable<?> 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.Von Klasse geerbte Methoden DataAccessor
equals, getIndex, getSource, getStatistics, hashCode, iterator, toArray, toStringVon Schnittstelle geerbte Methoden Iterable
forEach, spliterator
-
Konstruktordetails
-
Row
Initializes a new view on the specified row of a data source. The index is not validated here; an invalid one only shows when the row is read.- Parameter:
source- Data source to read through to.row- Row index, starting at 0.
-
-
Methodendetails
-
get
Beschreibung aus Klasse kopiert:DataAccessorReturns the value of the data source for the specified index.- Angegeben von:
getin KlasseDataAccessor- Parameter:
col- Index.- Gibt zurück:
- Value of the accessed cell.
-
size
public int size()Beschreibung aus Klasse kopiert:DataAccessorReturns the number of elements in this column.- Angegeben von:
sizein KlasseDataAccessor- Gibt zurück:
- Number of elements
-
isColumnNumeric
public boolean isColumnNumeric(int columnIndex) Returns whether the column at the specified index contains numbers.- Parameter:
columnIndex- Index of the column to test.- Gibt zurück:
trueif the column is numeric, otherwisefalse.
-