Interface IDataColumn
- All Superinterfaces:
IModifiable<Integer,,Object, IDataColumn> IModifiableByIndex<Object,IDataColumn>
- All Known Implementing Classes:
DataColumn
Generic interface for the DataColumn class.
Allows columns that can store different data types to be stored
in a generic collection without losing type specific information.
Created by Martin Cooper on 13/07/2017.
-
Method Summary
Modifier and TypeMethodDescription<V> io.vavr.control.Try<DataColumn<V>>Returns the generic data column as it's typed implementation.io.vavr.control.Try<IDataColumn>buildFromRows(io.vavr.collection.Seq<Integer> rowIndexes) Builds a new DataColumn from the data in the specified row indexes.io.vavr.collection.Vectordata()The underlying data.booleanChecks if the data column supports comparable for sorting.name()The column name.type()The data type of the column.Returns the value at the specified index.Methods inherited from interface com.github.martincooper.datatable.IModifiable
add, insert, remove, replace
-
Method Details
-
name
String name()The column name.- Returns:
- Returns the column name.
-
type
Type type()The data type of the column.- Returns:
- Returns the column type.
-
data
io.vavr.collection.Vector data()The underlying data.- Returns:
- Returns access to the underlying data.
-
valueAt
Returns the value at the specified index.- Parameters:
rowIndex- The row index.- Returns:
- Returns the value.
-
asType
Returns the generic data column as it's typed implementation. If the types don't match, then it'll return Failure.- Type Parameters:
V- The type.- Parameters:
type- The type of the column.- Returns:
- Returns the typed Data Column wrapped in a Try.
-
IsComparable
boolean IsComparable()Checks if the data column supports comparable for sorting.- Returns:
- Returns true if the column type supports Comparable.
-
buildFromRows
Builds a new DataColumn from the data in the specified row indexes.- Parameters:
rowIndexes- The rows which the new column data is to be built from.- Returns:
- Returns a new IDataColumn with just the rows specified.
-