Interface IDataColumn

All Superinterfaces:
IModifiable<Integer,Object,IDataColumn>, IModifiableByIndex<Object,IDataColumn>
All Known Implementing Classes:
DataColumn

public interface IDataColumn extends IModifiableByIndex<Object,IDataColumn>
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 Type
    Method
    Description
    <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 in the specified row indexes.
    io.vavr.collection.Vector
    The underlying data.
    boolean
    Checks if the data column supports comparable for sorting.
    The column name.
    The data type of the column.
    valueAt(Integer rowIndex)
    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

      Object valueAt(Integer rowIndex)
      Returns the value at the specified index.
      Parameters:
      rowIndex - The row index.
      Returns:
      Returns the value.
    • asType

      <V> io.vavr.control.Try<DataColumn<V>> asType(Class<V> type)
      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

      io.vavr.control.Try<IDataColumn> buildFromRows(io.vavr.collection.Seq<Integer> rowIndexes)
      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.