public class TemporaryView extends java.lang.Object implements Relation, it.unimi.dsi.fastutil.ints.IntIterable
The view is only good until the structure of the underlying table changes, after which it is marked 'stale'. At that point, it's operations will return an error.
View is something of a misnomer, as it is not like a database view, which is merely a query masquerading as a table, nor is it like a materialized database view, which is like a real table.
Constructor and Description |
---|
TemporaryView(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 and Description |
---|---|
void |
addColumn(Column... column) |
Table |
asTable() |
BooleanColumn |
booleanColumn(int columnIndex) |
BooleanColumn |
booleanColumn(java.lang.String columnName) |
CategoryColumn |
categoryColumn(int columnIndex) |
CategoryColumn |
categoryColumn(java.lang.String columnName) |
void |
clear()
Clears all rows from this View, leaving the structure in place
|
Column |
column(int columnIndex)
Returns the column at columnIndex (0-based)
|
int |
columnCount()
Returns the number of columns in the relation
|
int |
columnIndex(Column column)
Returns the index of the given column
|
java.util.List<java.lang.String> |
columnNames() |
java.util.List<Column> |
columns()
Returns a list of all the columns in the relation
|
int[] |
colWidths()
Returns an array of column widths for printing tables
|
DateColumn |
dateColumn(int columnIndex) |
DateColumn |
dateColumn(java.lang.String columnName) |
DateTimeColumn |
dateTimeColumn(int columnIndex) |
DateTimeColumn |
dateTimeColumn(java.lang.String columnName) |
Table |
first(int nRows) |
FloatColumn |
floatColumn(int columnIndex) |
FloatColumn |
floatColumn(java.lang.String columnName) |
java.lang.String |
get(int c,
int r)
Returns a String representing the value found at column index c and row index r
|
IntColumn |
intColumn(int columnIndex) |
IntColumn |
intColumn(java.lang.String columnName) |
it.unimi.dsi.fastutil.ints.IntIterator |
iterator() |
LongColumn |
longColumn(int columnIndex) |
LongColumn |
longColumn(java.lang.String columnName) |
java.lang.String |
name()
Returns the name of this relation
|
NumericColumn |
numericColumn(int columnIndex) |
NumericColumn |
numericColumn(java.lang.String columnName) |
java.lang.String |
print() |
double |
reduce(java.lang.String numericColumnName,
NumericReduceFunction function)
Returns the result of applying the given function to the specified column
|
void |
removeColumns(Column... columns)
Removes the given columns from the receiver
|
int |
rowCount()
Returns the number of rows in the relation
|
void |
setName(java.lang.String name) |
ShortColumn |
shortColumn(int columnIndex) |
ShortColumn |
shortColumn(java.lang.String columnName) |
TimeColumn |
timeColumn(int columnIndex) |
TimeColumn |
timeColumn(java.lang.String columnName) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
column, columnIndex, columnTypes, isEmpty, nCol, nCol, removeColumn, removeColumns, shape, structure, summary
public Column column(int columnIndex)
Relation
public int columnCount()
Relation
columnCount
in interface Relation
public int rowCount()
Relation
public java.util.List<Column> columns()
Relation
public int columnIndex(Column column)
Relation
columnIndex
in interface Relation
public java.lang.String get(int c, int r)
Relation
public java.lang.String name()
Relation
public void clear()
public java.util.List<java.lang.String> columnNames()
columnNames
in interface Relation
public void removeColumns(Column... columns)
Relation
removeColumns
in interface Relation
public int[] colWidths()
public Table asTable()
public double reduce(java.lang.String numericColumnName, NumericReduceFunction function)
numericColumnName
- The name of a numeric (integer, float, etc.) column in this tablefunction
- A numeric reduce functionjava.lang.IllegalArgumentException
- if numericColumnName doesn't name a numeric column in this tablepublic java.lang.String toString()
toString
in class java.lang.Object
public BooleanColumn booleanColumn(int columnIndex)
booleanColumn
in interface Relation
public BooleanColumn booleanColumn(java.lang.String columnName)
booleanColumn
in interface Relation
public FloatColumn floatColumn(int columnIndex)
floatColumn
in interface Relation
public FloatColumn floatColumn(java.lang.String columnName)
floatColumn
in interface Relation
public IntColumn intColumn(java.lang.String columnName)
public ShortColumn shortColumn(java.lang.String columnName)
shortColumn
in interface Relation
public ShortColumn shortColumn(int columnIndex)
shortColumn
in interface Relation
public LongColumn longColumn(java.lang.String columnName)
longColumn
in interface Relation
public LongColumn longColumn(int columnIndex)
longColumn
in interface Relation
public DateColumn dateColumn(int columnIndex)
dateColumn
in interface Relation
public DateColumn dateColumn(java.lang.String columnName)
dateColumn
in interface Relation
public TimeColumn timeColumn(java.lang.String columnName)
timeColumn
in interface Relation
public TimeColumn timeColumn(int columnIndex)
timeColumn
in interface Relation
public DateTimeColumn dateTimeColumn(int columnIndex)
dateTimeColumn
in interface Relation
public DateTimeColumn dateTimeColumn(java.lang.String columnName)
dateTimeColumn
in interface Relation
public CategoryColumn categoryColumn(java.lang.String columnName)
categoryColumn
in interface Relation
public CategoryColumn categoryColumn(int columnIndex)
categoryColumn
in interface Relation
public NumericColumn numericColumn(int columnIndex)
numericColumn
in interface Relation
public NumericColumn numericColumn(java.lang.String columnName)
numericColumn
in interface Relation
public it.unimi.dsi.fastutil.ints.IntIterator iterator()
iterator
in interface it.unimi.dsi.fastutil.ints.IntIterable
iterator
in interface java.lang.Iterable<java.lang.Integer>