Comparator<T>
, Iterable<T>
BooleanMapUtils
, CategoricalColumn<T>
, DateFilters
, DateMapFunctions
, DateTimeFilters
, DateTimeMapFunctions
, NumberColumn
, NumberPredicates
, StringFilters
, StringMapFunctions
, StringReduceUtils
, TimeFilters
, TimeMapFunctions
AbstractColumn
, BooleanColumn
, DateColumn
, DateTimeColumn
, DoubleColumn
, StringColumn
, TimeColumn
public interface Column<T> extends Iterable<T>, Comparator<T>
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 | Description |
---|---|---|
Column<T> |
append(T value) |
|
Column<T> |
append(Column<T> column) |
|
Column<T> |
appendCell(String stringValue) |
|
Column<T> |
appendCell(String stringValue,
StringParser parser) |
|
Column<T> |
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() |
|
default int |
columnWidth() |
Returns the width of the column in characters, for printing
|
Column<T> |
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 <T> Column<T> |
create(String columnName,
ColumnType<T> type) |
|
default void |
doWithEach(Consumer<T> consumer) |
Applies the given consumer to each element in this column
|
Column<T> |
emptyCopy() |
Returns a copy of the receiver with no data.
|
Column<T> |
emptyCopy(int rowSize) |
Returns an empty copy of the receiver, with its internal storage initialized to the given row size.
|
default Column<T> |
fillMissing(T defaultVal) |
Create a copy of this column where missing values are replaced with the given default value
|
default Column<T> |
fillMissing(Column<T> other) |
Create a copy of this column where missing values are replaced with the corresponding value in the given column
|
default Column<T> |
first(int numRows) |
|
T |
get(int row) |
|
double |
getDouble(int row) |
Returns a double representation of the value at the given row.
|
String |
getString(int row) |
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int r) |
|
default Column<T> |
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<T> |
lag(int n) |
Returns a column of the same type and size as the receiver, containing the receivers values offset by n.
|
default Column<T> |
last(int numRows) |
|
default Column<T> |
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.
|
default String |
print() |
TODO(lwhite): Print n from the top and bottom, like a table;
|
Column<T> |
removeMissing() |
|
default RollingColumn |
rolling(int windowSize) |
|
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
|
default Column<T> |
rows(int... indices) |
Returns a column containing the values in this column with the given indices
|
default Column<T> |
sampleN(int n) |
Returns a column containing a random sample of the values in this column
|
default Column<T> |
sampleX(double proportion) |
Returns a table consisting of randomly selected values from this column.
|
Column<T> |
set(int row,
T value) |
|
Column<T> |
setName(String name) |
Sets the columns name to the given string
|
int |
size() |
|
void |
sortAscending() |
|
void |
sortDescending() |
|
default Column<T> |
subset(Selection rows) |
|
Table |
summary() |
|
default String |
title() |
|
ColumnType |
type() |
Returns this column's ColumnType
|
Column<T> |
unique() |
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
Column<T> |
where(Selection selection) |
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
forEach, iterator, spliterator
static <T> Column<T> create(String columnName, ColumnType<T> type)
int size()
Table summary()
Object[] asObjectArray()
int countMissing()
default int countUnique()
Column<T> unique()
Column
default Column<T> lead(int n)
Column<T> 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<T> 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.T get(int row)
double getDouble(int row)
row
- The index of the row.Column<T> emptyCopy()
Column
Column<T> emptyCopy(int rowSize)
rowSize
- the initial row sizeColumn
void clear()
void sortAscending()
void sortDescending()
boolean isEmpty()
Column<T> appendCell(String stringValue, StringParser parser)
it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
default String title()
double[] asDoubleArray()
default Column<T> inRange(int start, int end)
default Column<T> rows(int... indices)
default Column<T> sampleN(int n)
n
- the number of values to selectdefault Column<T> 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)
default void doWithEach(Consumer<T> consumer)
default String print()
default Column<T> fillMissing(Column<T> other)
default Column<T> fillMissing(T defaultVal)
default int columnWidth()
Copyright © 2018. All rights reserved.