public interface Column
Columns can either exist on their own or be a part of a table. All the data in a single column is of a particular type.
Modifier and Type | Method and Description |
---|---|
void |
append(Column column) |
Column |
appendCell(String stringValue) |
Column |
appendCell(String stringValue,
StringParser parser) |
Column |
appendMissing()
Appends a missing value appropriate to the column
|
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[].
|
double[] |
asDoubleArray() |
Object[] |
asObjectArray() |
int |
byteSize()
Returns the width of a cell in this column, in bytes.
|
void |
clear() |
int |
columnWidth()
Returns the width of the column in characters, for printing
|
Column |
copy()
Returns a deep copy of the receiver
|
int |
countMissing()
Returns the count of missing values in this column.
|
default int |
countUnique()
Returns the count of unique values in this column.
|
static Column |
create(String columnName,
ColumnType type) |
Column |
emptyCopy()
Returns a copy of the receiver with no data.
|
Column |
emptyCopy(int rowSize)
Returns an empty copy of the receiver, with its internal storage initialized to the given row size.
|
default Column |
first(int numRows) |
double |
getDouble(int row)
Returns a double representation of the value at the given row.
|
Object |
getObject(int index) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int r) |
default Column |
inRange(int start,
int end)
Returns a column containing the rows in this column beginning with start inclusive, and ending with end exclusive
|
boolean |
isEmpty()
Returns true if the column has no data
|
Selection |
isMissing() |
boolean |
isMissing(int rowNumber) |
Selection |
isNotMissing() |
Column |
lag(int n)
Returns a column of the same type and size as the receiver, containing the receivers values offset by n.
|
default Column |
last(int numRows) |
default Column |
lead(int n)
Returns a column of the same type as the receiver, containing the receivers values offset -n
For example if you lead a column containing 2, 3, 4 by 1, you get a column containing 3, 4, NA.
|
String |
name()
Returns the column's name.
|
String |
print()
TODO(lwhite): Print n from the top and bottom, like a table;
|
Column |
removeMissing() |
default RollingColumn |
rolling(int windowSize) |
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
default Column |
rows(int... indices)
Returns a column containing the values in this column with the given indices
|
default Column |
sampleN(int n)
Returns a column containing a random sample of the values in this column
|
default Column |
sampleX(double proportion)
Returns a table consisting of randomly selected values from this column.
|
Column |
setName(String name)
Sets the columns name to the given string
|
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
default Column |
subset(Selection rows) |
default double |
summarizeIf(Selection selection,
AggregateFunction function) |
Table |
summary() |
default String |
title() |
ColumnType |
type()
Returns this column's ColumnType
|
Column |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
Column |
where(Selection selection) |
static Column create(String columnName, ColumnType type)
int size()
Table summary()
Object[] asObjectArray()
default double summarizeIf(Selection selection, AggregateFunction function)
int countMissing()
default int countUnique()
Column unique()
Column
default Column lead(int n)
Column lag(int n)
For example if you lag a column containing 2, 3, 4 by 1, you get a column containing NA, 2, 3
String name()
Column setName(String name)
name
- The new name MUST be unique for any table containing this columnColumnType type()
ColumnType
String getString(int row)
row
- The index of the row.double getDouble(int row)
row
- The index of the row.Column emptyCopy()
Column
Column emptyCopy(int rowSize)
rowSize
- the initial row sizeColumn
void clear()
void sortAscending()
void sortDescending()
boolean isEmpty()
Column appendCell(String stringValue, StringParser parser)
it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
void append(Column column)
default Column first(int numRows)
default Column last(int numRows)
String print()
default String title()
double[] asDoubleArray()
int columnWidth()
default Column inRange(int start, int end)
default Column rows(int... indices)
default Column sampleN(int n)
n
- the number of values to selectdefault Column sampleX(double proportion)
proportion
- The proportion to go in the sampleSelection isMissing()
Selection isNotMissing()
int byteSize()
byte[] asBytes(int rowNumber)
rowNumber
- index of the rowdefault RollingColumn rolling(int windowSize)
String getUnformattedString(int r)
boolean isMissing(int rowNumber)
Column appendMissing()
Column removeMissing()
Object getObject(int index)
Copyright © 2018. All rights reserved.