Iterable<C>
, Comparator<C>
, Column<T>
AbstractStringColumn
, BooleanColumn
, DateColumn
, DateTimeColumn
, InstantColumn
, NumberColumn
, TimeColumn
public abstract class AbstractColumn<C extends Column<T>,T> extends Object implements Column<T>
Column
interfaceModifier and Type | Field | Description |
---|---|---|
static int |
DEFAULT_ARRAY_SIZE |
Constructor | Description |
---|---|
AbstractColumn(ColumnType type,
String name,
AbstractColumnParser<T> parser) |
Constructs a column with the given
ColumnType , name, and AbstractColumnParser |
Modifier and Type | Method | Description |
---|---|---|
StringColumn |
asStringColumn() |
Returns a StringColumn consisting of the (unformatted) String representation of this column
values
|
abstract Column<T> |
emptyCopy() |
Returns a copy of the receiver with no data.
|
C |
filter(Predicate<? super T> test) |
Returns a new Column of the same type with only those rows satisfying the predicate
|
C |
first(int numRows) |
Returns a column of the same type containing the first
numRows of this column. |
int |
indexOf(Object o) |
Returns the index of the first occurrence of
o in the column or -1 if the element is
not in the column. |
C |
inRange(int start,
int end) |
Returns a column containing the rows in this column beginning with start inclusive, and ending
with end exclusive
|
C |
last(int numRows) |
Returns a column of the same type containing the last
numRows of this column. |
C |
map(Function<? super T,? extends T> fun) |
Maps the function across all rows, appending the results to a new Column of the same type
|
C |
max(Column<T> other) |
Returns a column containing the element-wise min between this column and other column
|
C |
min(Column<T> other) |
Returns a column containing the element-wise min between this column and other column
|
String |
name() |
Returns the column's name.
|
AbstractColumnParser<T> |
parser() |
Returns the parser used by
Column.appendCell(String) ()}. |
C |
sampleN(int n) |
Returns a column containing a random sample of the values in this column
|
C |
sampleX(double proportion) |
Returns a table consisting of randomly selected values from this column.
|
C |
set(Selection rowSelection,
T newValue) |
Conditionally update this column, replacing current values with newValue for all rows where the
current value matches the selection criteria
|
C |
set(Selection condition,
Column<T> other) |
Updates this column where values matching the selection are replaced with the corresponding
value from the given column
|
C |
setName(String name) |
Sets the columns name to the given string
|
C |
setParser(AbstractColumnParser<T> parser) |
Sets the parser used by
Column.appendCell(String) |
C |
sorted(Comparator<? super T> comp) |
Returns a new Column of the same type sorted according to the provided Comparator
|
C |
subset(int[] rows) |
Return a column of the same type containing just those elements whose indexes are included in
the given array
|
String |
toString() |
|
ColumnType |
type() |
Returns this column's ColumnType
|
allMatch, anyMatch, append, append, append, appendCell, appendCell, appendMissing, appendObj, asBytes, asList, asObjectArray, asSet, byteSize, clear, columnWidth, contains, copy, count, count, countMissing, countUnique, emptyCopy, equals, get, getString, getUnformattedString, interpolate, isEmpty, isMissing, isMissing, isNotMissing, lag, lead, map, mapInto, max, min, noneMatch, print, reduce, reduce, removeMissing, rolling, rowComparator, set, set, set, set, setMissing, setMissingTo, size, sortAscending, sortDescending, summary, title, unique, valueHash, where
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
forEach, iterator, spliterator
public static final int DEFAULT_ARRAY_SIZE
public AbstractColumn(ColumnType type, String name, AbstractColumnParser<T> parser)
ColumnType
, name, and AbstractColumnParser
public String name()
public AbstractColumnParser<T> parser()
Column.appendCell(String)
()}.public C setParser(AbstractColumnParser<T> parser)
Column.appendCell(String)
public ColumnType type()
public abstract Column<T> emptyCopy()
public C filter(Predicate<? super T> test)
public C sorted(Comparator<? super T> comp)
public C map(Function<? super T,? extends T> fun)
public C min(Column<T> other)
TODO(lwhite) Override in column subtypes for better performance
public C max(Column<T> other)
TODO(lwhite) Override in column subtypes for better performance
public C set(Selection condition, Column<T> other)
public C set(Selection rowSelection, T newValue)
public C first(int numRows)
numRows
of this column.public C last(int numRows)
numRows
of this column.public C sampleN(int n)
public C sampleX(double proportion)
public C subset(int[] rows)
public C inRange(int start, int end)
public StringColumn asStringColumn()
asStringColumn
in interface Column<C extends Column<T>>
StringColumn
built using the column Column.getUnformattedString(int)
methodCopyright © 2022. All rights reserved.