Constructor | Description |
---|---|
Relation() |
Modifier and Type | Method | Description |
---|---|---|
abstract Relation |
addColumns(Column<?>... cols) |
|
TableConverter |
as() |
|
BooleanColumn |
booleanColumn(int columnIndex) |
|
BooleanColumn |
booleanColumn(String columnName) |
|
BooleanColumn[] |
booleanColumns() |
|
CategoricalColumn<?> |
categoricalColumn(int columnNumber) |
|
CategoricalColumn<?> |
categoricalColumn(String columnName) |
|
List<CategoricalColumn<?>> |
categoricalColumns(String... columnName) |
Returns the columns whose names are given in the input array
|
abstract void |
clear() |
Clears all the dat in the relation, leaving the structure intact
|
abstract Column<?> |
column(int columnIndex) |
Returns the column at columnIndex (0-based)
|
Column<?> |
column(String columnName) |
Returns the column with the given columnName, ignoring case
|
abstract int |
columnCount() |
Returns the number of columns in the relation
|
int |
columnIndex(String columnName) |
Returns the index of the column with the given columnName
|
abstract int |
columnIndex(Column<?> col) |
Returns the index of the given column
|
abstract List<String> |
columnNames() |
|
abstract List<Column<?>> |
columns() |
Returns a list of all the columns in the relation
|
List<Column<?>> |
columns(int... columnIndices) |
Returns the columns whose indices are given in the input array
|
List<Column<?>> |
columns(String... columnName) |
Returns the columns whose names are given in the input array
|
List<Column<?>> |
columnsOfType(ColumnType type) |
|
ColumnType[] |
columnTypes() |
Deprecated.
for API name consistency. Use
typeArray() instead. |
int[] |
colWidths() |
Returns an array of column widths for printing tables
|
boolean |
containsColumn(String columnName) |
|
boolean |
containsColumn(Column<?> column) |
|
DateColumn |
dateColumn(int columnIndex) |
|
DateColumn |
dateColumn(String columnName) |
|
DateColumn[] |
dateColumns() |
|
DateTimeColumn |
dateTimeColumn(int columnIndex) |
|
DateTimeColumn |
dateTimeColumn(String columnName) |
|
DateTimeColumn[] |
dateTimeColumns() |
|
DoubleColumn |
doubleColumn(int columnIndex) |
|
DoubleColumn |
doubleColumn(String columnName) |
|
abstract Table |
first(int nRows) |
|
FloatColumn |
floatColumn(int columnIndex) |
|
FloatColumn |
floatColumn(String columnName) |
|
Object |
get(int r,
int c) |
Returns the value at the given row and column indexes
|
String |
getString(int r,
int columnIndex) |
Returns a string representation of the value at the given row and column indexes
|
String |
getString(int r,
String columnName) |
Returns a string representation of the value at the given row and column indexes
|
String |
getUnformatted(int r,
int c) |
Returns a string representation of the value at the given row and column indexes
|
InstantColumn |
instantColumn(int columnIndex) |
|
InstantColumn |
instantColumn(String columnName) |
|
InstantColumn[] |
instantColumns() |
|
IntColumn |
intColumn(int columnIndex) |
|
IntColumn |
intColumn(String columnName) |
|
boolean |
isEmpty() |
|
LongColumn |
longColumn(int columnIndex) |
|
LongColumn |
longColumn(String columnName) |
|
abstract String |
name() |
Returns the name of this relation
|
NumericColumn<?> |
nCol(int columnIndex) |
Returns the column with the given name cast to a NumberColumn
|
NumericColumn<?> |
nCol(String columnName) |
Returns the column with the given name cast to a NumberColumn
|
NumericColumn<?> |
numberColumn(int columnIndex) |
Returns the NumberColumn at the given index.
|
NumericColumn<?> |
numberColumn(String columnName) |
|
NumericColumn<?>[] |
numberColumns() |
|
List<NumericColumn<?>> |
numericColumns() |
Returns all the NumericColumns in the relation
|
List<NumericColumn<?>> |
numericColumns(int... columnIndices) |
Returns all the NumericColumns in the relation
|
List<NumericColumn<?>> |
numericColumns(String... columnNames) |
Returns all the NumericColumns in the relation
|
String |
print() |
Returns a String containing a 'pretty-printed' representation of this table containing at most
20 rows.
|
String |
print(int rowLimit) |
|
String |
printAll() |
|
Relation |
removeColumns(int... columnIndexes) |
|
Relation |
removeColumns(String... columnName) |
|
abstract Relation |
removeColumns(Column<?>... columns) |
Removes the given columns from the receiver
|
abstract int |
rowCount() |
Returns the number of rows in the relation
|
abstract Relation |
setName(String name) |
|
String |
shape() |
|
ShortColumn |
shortColumn(int columnIndex) |
|
ShortColumn |
shortColumn(String columnName) |
|
SmileConverter |
smile() |
|
StringColumn |
stringColumn(int columnIndex) |
|
StringColumn |
stringColumn(String columnName) |
|
StringColumn[] |
stringColumns() |
|
Table |
structure() |
Returns the structure of the this relation as a 3-column Table, consisting of Index (an
IntColumn), Column Name (a StringColumn), and Column Type (a StringColumn)
|
Table |
summary() |
|
TextColumn |
textColumn(int columnIndex) |
|
TextColumn |
textColumn(String columnName) |
|
TimeColumn |
timeColumn(int columnIndex) |
|
TimeColumn |
timeColumn(String columnName) |
|
TimeColumn[] |
timeColumns() |
|
String |
toString() |
Returns a String containing a 'pretty-printed' representation of this table containing at most
20 rows.
|
ColumnType[] |
typeArray() |
Returns an array of the column types of all columns in the relation, including duplicates as
appropriate, and maintaining order
|
List<ColumnType> |
types() |
Returns a List of the column types of all columns in the relation, including duplicates as
appropriate, and maintaining order
|
forEach, iterator, spliterator
public boolean isEmpty()
public String shape()
public Relation removeColumns(int... columnIndexes)
public abstract Relation removeColumns(Column<?>... columns)
public List<Column<?>> columnsOfType(ColumnType type)
public abstract Table first(int nRows)
public int columnIndex(String columnName)
public Column<?> column(String columnName)
public abstract Column<?> column(int columnIndex)
columnIndex
- an integer at least 0 and less than number of columns in the relationpublic abstract int columnCount()
public abstract int rowCount()
public abstract List<Column<?>> columns()
public List<Column<?>> columns(String... columnName)
public List<Column<?>> columns(int... columnIndices)
public abstract int columnIndex(Column<?> col)
public Object get(int r, int c)
r
- the row index, 0 basedc
- the column index, 0 basedpublic abstract String name()
public abstract void clear()
@Deprecated public ColumnType[] columnTypes()
typeArray()
instead.public ColumnType[] typeArray()
public List<ColumnType> types()
public int[] colWidths()
public String toString()
public String printAll()
public String print(int rowLimit)
public String print()
public Table structure()
public Table summary()
public BooleanColumn booleanColumn(int columnIndex)
public BooleanColumn booleanColumn(String columnName)
public NumericColumn<?> numberColumn(int columnIndex)
columnIndex
- The 0-based index of a column in the tableClassCastException
- if the cast to NumberColumn failspublic NumericColumn<?> numberColumn(String columnName)
public DoubleColumn doubleColumn(String columnName)
public DoubleColumn doubleColumn(int columnIndex)
public StringColumn[] stringColumns()
public NumericColumn<?>[] numberColumns()
public List<NumericColumn<?>> numericColumns()
public List<NumericColumn<?>> numericColumns(int... columnIndices)
public List<NumericColumn<?>> numericColumns(String... columnNames)
public BooleanColumn[] booleanColumns()
public DateColumn[] dateColumns()
public DateTimeColumn[] dateTimeColumns()
public InstantColumn[] instantColumns()
public TimeColumn[] timeColumns()
public CategoricalColumn<?> categoricalColumn(String columnName)
public CategoricalColumn<?> categoricalColumn(int columnNumber)
public List<CategoricalColumn<?>> categoricalColumns(String... columnName)
public NumericColumn<?> nCol(String columnName)
Shorthand for numberColumn()
public NumericColumn<?> nCol(int columnIndex)
Shorthand for numberColumn()
public IntColumn intColumn(int columnIndex)
public ShortColumn shortColumn(String columnName)
public ShortColumn shortColumn(int columnIndex)
public LongColumn longColumn(String columnName)
public LongColumn longColumn(int columnIndex)
public FloatColumn floatColumn(String columnName)
public FloatColumn floatColumn(int columnIndex)
public DateColumn dateColumn(int columnIndex)
public DateColumn dateColumn(String columnName)
public TimeColumn timeColumn(String columnName)
public TimeColumn timeColumn(int columnIndex)
public StringColumn stringColumn(String columnName)
public StringColumn stringColumn(int columnIndex)
public TextColumn textColumn(String columnName)
public TextColumn textColumn(int columnIndex)
public DateTimeColumn dateTimeColumn(int columnIndex)
public DateTimeColumn dateTimeColumn(String columnName)
public InstantColumn instantColumn(int columnIndex)
public InstantColumn instantColumn(String columnName)
public TableConverter as()
public SmileConverter smile()
public String getUnformatted(int r, int c)
r
- the row index, 0 basedc
- the column index, 0 basedpublic String getString(int r, String columnName)
r
- the row index, 0 basedcolumnName
- the name of the column to be returned
// TODO: performance would be enhanced if columns could be referenced via a hashTable
public String getString(int r, int columnIndex)
r
- the row index, 0 basedcolumnIndex
- the index of the column to be returned
// TODO: performance would be enhanced if columns could be referenced via a hashTable
public boolean containsColumn(Column<?> column)
public boolean containsColumn(String columnName)
Copyright © 2021. All rights reserved.