public class TableSlice extends Relation
A TableSlice is only good until the structure of the underlying table changes.
| Constructor | Description |
|---|---|
TableSlice(Table table) |
Returns a new view constructed from the given table.
|
TableSlice(Table table,
Selection rowSelection) |
Returns a new View constructed from the given table, containing only the rows represented by
the bitmap
|
| Modifier and Type | Method | Description |
|---|---|---|
TableSlice |
addColumns(Column<?>... column) |
Adds the given columns to this Relation and returns the same relation.
|
Table |
asTable() |
|
void |
clear() |
Clears all rows from this View, leaving the structure in place
|
Column<?> |
column(int columnIndex) |
Returns the column at columnIndex (0-based)
|
Column<?> |
column(String columnName) |
Returns the column with the given columnName, ignoring case
|
int |
columnCount() |
Returns the number of columns in the relation
|
int |
columnIndex(Column<?> column) |
Returns the index of the given column
|
List<String> |
columnNames() |
Returns a list containing the names of all the columns in this relation
|
List<Column<?>> |
columns() |
Returns a list of all the columns in the relation
|
Table |
first(int nRows) |
Returns a new table containing the first n rows in this Relation
|
Object |
get(int r,
int c) |
Returns the value at the given row and column indexes
|
Table |
getTable() |
|
Iterator<Row> |
iterator() |
Iterate over the underlying rows in the source table.
|
int |
mappedRowNumber(int rowNumber) |
Maps the view row number to the row number on the underlying source table.
|
String |
name() |
Returns the name of this relation
|
double |
reduce(String numberColumnName,
NumericAggregateFunction function) |
Returns the result of applying the given function to the specified column
|
TableSlice |
removeColumns(Column<?>... columns) |
Removes the given columns from this Relation and returns the same relation.
|
void |
removeSelection() |
Removes the selection from this view, leaving it with the same number of rows as the underlying
source table.
|
void |
removeSort() |
Removes the sort from this View.
|
int |
rowCount() |
Returns the number of rows in the relation
|
TableSlice |
setName(String name) |
Sets the name of this Relation and returns the same relation.
|
void |
sortOn(Sort key) |
Sort this view in place without modifying or copying the underlying source table.
|
protected PrimitiveIterator.OfInt |
sourceRowNumberIterator() |
IntIterator of source table row numbers that are present in this view.
|
forEach, spliteratorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitas, booleanColumn, booleanColumn, booleanColumns, categoricalColumn, categoricalColumn, categoricalColumns, columnIndex, columns, columns, columnsOfType, columnTypes, colWidths, containsColumn, containsColumn, dateColumn, dateColumn, dateColumns, dateTimeColumn, dateTimeColumn, dateTimeColumns, doubleColumn, doubleColumn, floatColumn, floatColumn, getString, getString, getUnformatted, instantColumn, instantColumn, instantColumns, intColumn, intColumn, isEmpty, longColumn, longColumn, nCol, nCol, numberColumn, numberColumn, numberColumns, numericColumns, numericColumns, numericColumns, print, print, printAll, removeColumns, removeColumns, shape, shortColumn, shortColumn, smile, stringColumn, stringColumn, stringColumns, structure, summary, textColumn, textColumn, timeColumn, timeColumn, timeColumns, toString, typeArray, typespublic TableSlice(Table table, Selection rowSelection)
public TableSlice(Table table)
public Column<?> column(int columnIndex)
Relationpublic Column<?> column(String columnName)
Relationpublic int columnCount()
RelationcolumnCount in class Relationpublic int rowCount()
Relationpublic List<Column<?>> columns()
Relationpublic int columnIndex(Column<?> column)
RelationcolumnIndex in class Relationpublic Object get(int r, int c)
Relationpublic String name()
Relationpublic Table getTable()
public void clear()
public void removeSort()
public void removeSelection()
public List<String> columnNames()
RelationcolumnNames in class Relationpublic TableSlice addColumns(Column<?>... column)
RelationaddColumns in class Relationpublic TableSlice removeColumns(Column<?>... columns)
RelationremoveColumns in class Relationpublic Table first(int nRows)
Relationpublic TableSlice setName(String name)
Relationpublic Table asTable()
protected PrimitiveIterator.OfInt sourceRowNumberIterator()
public double reduce(String numberColumnName, NumericAggregateFunction function)
numberColumnName - The name of a numeric column in this tablefunction - A numeric reduce functionIllegalArgumentException - if numberColumnName doesn't name a numeric column in this
tablepublic Iterator<Row> iterator()
public int mappedRowNumber(int rowNumber)
rowNumber - the row number in the view.public void sortOn(Sort key)
Table.sortOn(Sort) which returns a copy of the table, this method sorts the view in place.key - to sort on.Copyright © 2021. All rights reserved.