public class DataColumn<T> extends Object implements IDataColumn
| Constructor and Description |
|---|
DataColumn(Class<T> type,
String columnName)
DataColumn constructor.
|
DataColumn(Class<T> type,
String columnName,
Iterable<T> data)
DataColumn constructor.
|
DataColumn(Class<T> type,
String columnName,
T[] data)
DataColumn constructor.
|
DataColumn(Class<T> type,
String columnName,
io.vavr.collection.Vector<T> data)
DataColumn constructor.
|
| Modifier and Type | Method and Description |
|---|---|
io.vavr.control.Try<IDataColumn> |
add(Object value)
Attempts to add / append a new item to the end of the column.
|
io.vavr.control.Try<DataColumn<T>> |
addItem(T value)
Adds / Appends and item to the end of the column.
|
<V> io.vavr.control.Try<DataColumn<V>> |
asType(Class<V> type)
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 at the specified row indexes.
|
io.vavr.collection.Vector<T> |
data()
Returns the underlying data.
|
io.vavr.control.Try<IDataColumn> |
insert(Integer index,
Object value)
Attempts to insert a new item into the column.
|
io.vavr.control.Try<DataColumn<T>> |
insertItem(Integer index,
T value)
Inserts the item at the specified index.
|
boolean |
IsComparable()
Checks if the data column supports comparable for sorting.
|
String |
name()
Gets the column name.
|
io.vavr.control.Try<IDataColumn> |
remove(Integer index)
Attempts to remove an existing item at the specified index.
|
io.vavr.control.Try<DataColumn<T>> |
removeItem(Integer index)
Removes the item at the specified index.
|
io.vavr.control.Try<IDataColumn> |
replace(Integer index,
Object value)
Attempts to replace an existing item with a new item in the column.
|
io.vavr.control.Try<DataColumn<T>> |
replaceItem(Integer index,
T value)
Replaces the existing item at the specified index with the new item.
|
Type |
type()
Gets the column type.
|
T |
valueAt(Integer rowIndex)
Returns the value at the specified index.
|
public DataColumn(Class<T> type, String columnName)
type - Stores the type of data stored in this column.columnName - The column name.public DataColumn(Class<T> type, String columnName, T[] data)
type - Stores the type of data stored in this column.columnName - The column name.data - The data items stored in the column.public DataColumn(Class<T> type, String columnName, Iterable<T> data)
type - Stores the type of data stored in this column.columnName - The column name.data - The data items stored in the column.public String name()
name in interface IDataColumnpublic Type type()
type in interface IDataColumnpublic io.vavr.collection.Vector<T> data()
data in interface IDataColumnpublic T valueAt(Integer rowIndex)
valueAt in interface IDataColumnrowIndex - The row index.public <V> io.vavr.control.Try<DataColumn<V>> asType(Class<V> type)
asType in interface IDataColumnV - The type.type - The type of the column.public io.vavr.control.Try<IDataColumn> buildFromRows(io.vavr.collection.Seq<Integer> rowIndexes)
buildFromRows in interface IDataColumnrowIndexes - The rows which the new column data is to be built from.public io.vavr.control.Try<IDataColumn> add(Object value)
add in interface IModifiable<Integer,Object,IDataColumn>value - The item required to be added.public io.vavr.control.Try<IDataColumn> insert(Integer index, Object value)
insert in interface IModifiable<Integer,Object,IDataColumn>index - The index the item is to be inserted at.value - The item required to be inserted.public io.vavr.control.Try<IDataColumn> replace(Integer index, Object value)
replace in interface IModifiable<Integer,Object,IDataColumn>index - The index the item is to be replaced at.value - The new item.public io.vavr.control.Try<IDataColumn> remove(Integer index)
remove in interface IModifiable<Integer,Object,IDataColumn>index - The index to remove the item at.public io.vavr.control.Try<DataColumn<T>> addItem(T value)
value - The value to append.public io.vavr.control.Try<DataColumn<T>> insertItem(Integer index, T value)
index - The index to insert the item at.value - The item to insert.public io.vavr.control.Try<DataColumn<T>> replaceItem(Integer index, T value)
index - The index to replace the existing item.value - The new item to replace the existing one.public io.vavr.control.Try<DataColumn<T>> removeItem(Integer index)
index - The index to remove the item at.public boolean IsComparable()
IsComparable in interface IDataColumnCopyright © 2017. All rights reserved.