Class DataRow
java.lang.Object
com.github.martincooper.datatable.DataRow
A row of data in the DataTable.
Created by Martin Cooper on 08/07/2017.
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.vavr.control.Try<DataRow>Builds an instance of a DataRow.Object[]data()Returns the data as an array for this row.io.vavr.control.Try<Object>Returns the data at the specified column index, returning as an object.io.vavr.control.Try<Object>Returns the data in the specified column name, returning as an object.<T> TReturns the value of a particular row column as a specific type.<T> TReturns the value of a particular row column as a specific type.rowIdx()Gets the row index.table()Returns the underlying Data Table for this row.<T> io.vavr.control.Try<T>Returns the value of a particular row column as a specific type.<T> io.vavr.control.Try<T>Returns the value of a particular row column as a specific type.
-
Method Details
-
table
Returns the underlying Data Table for this row.- Returns:
- Returns the Data Table for this row .
-
rowIdx
Gets the row index.- Returns:
- Returns the row index.
-
data
Returns the data as an array for this row.- Returns:
- Returns the data for this row in an array.
-
get
Returns the data at the specified column index, returning as an object.- Parameters:
colIndex- The column index to return the value of.- Returns:
- Returns the value of the row at the specified column.
-
get
Returns the data in the specified column name, returning as an object.- Parameters:
colName- The column to return the value of.- Returns:
- Returns the value of the row at the specified column.
-
getAs
Returns the value of a particular row column as a specific type. This method makes no bounds checks or type checks, so any failures will result in an exception being thrown.- Type Parameters:
T- The value type.- Parameters:
type- The data type.idx- The index of the column.- Returns:
- Returns the value at the specified index.
-
getAs
Returns the value of a particular row column as a specific type. This method makes no bounds checks or type checks, so any failures will result in an exception being thrown.- Type Parameters:
T- The value type.- Parameters:
type- The data type.colName- The name of the column.- Returns:
- Returns the value at the specified index.
-
tryGetAs
Returns the value of a particular row column as a specific type. This method performs bounds checks and type checks. Any errors will return a Try.failure.- Type Parameters:
T- The value type.- Parameters:
type- The data type.idx- The index of the column.- Returns:
- Returns the value at the specified index.
-
tryGetAs
Returns the value of a particular row column as a specific type. This method performs bounds checks and type checks. Any errors will return a Try.failure.- Type Parameters:
T- The value type.- Parameters:
type- The data type.colName- The name of the column.- Returns:
- Returns the value at the specified index.
-
build
Builds an instance of a DataRow. Row Index is validated before creation, returning a Failure on error.- Parameters:
table- The DataTable the DataRow is pointing to.rowIdx- The row index.- Returns:
- Returns a DataRow wrapped in a Try.
-