public class DateSeriesImpl extends AbstractList<Row> implements DateSeries
modCount| Modifier and Type | Method and Description |
|---|---|
DataFrame |
append(DataFrame df)
Appends the specified dataframe to this one by calling
Column.append(Column) on each pair of columns, and keeping the
meta-data from this dataframe. |
DataFrame |
append(DataFrame df,
boolean coerce)
Appends the specified dataframe to this one by calling
Column.append(Column,boolean) on each pair of columns, and keeping
the meta-data from this dataframe. |
DateSeries |
append(DateSeries df)
Appends the specified
DateSeries to this one by calling
Column.append(Column) on both the key and value columns, and keeping
the meta-data from this dataframe. |
Map<LocalDate,Double> |
asMap()
Returns an immutable
Map view of this time series. |
BooleanColumn |
booleanColumn(int columnIndex)
Returns the
BooleanColumn at the specified index. |
BooleanColumn |
booleanColumn(String columnName)
Returns the specified
BooleanColumn |
<T> Column<T> |
column(int columnIndex)
Returns the
Column at the specified index. |
<T> Column<T> |
column(String columnName)
Returns the specified
Column |
int |
columnCount()
Returns the number of columns in this dataframe.
|
int |
columnIndex(String columnName)
Returns the index of the specified column.
|
LinkedHashMap<String,Column<?>> |
columnMap()
Returns an ordered map where the entries are (name, column) pairs.
|
String |
columnName(int columnIndex)
Returns the column name at the specified index.
|
List<String> |
columnNames()
Returns a list of column names in this dataframe.
|
List<Column<?>> |
columns()
Returns a list of columns in this dataframe.
|
ColumnType |
columnType(int columnIndex)
Returns the
column type at the specified index. |
ColumnType |
columnType(String columnName)
Returns the
column type at the specified index. |
List<ColumnType<?>> |
columnTypes()
Returns a list of column types in this dataframe.
|
DataFrame |
copy()
Returns a deep copy of this dataframe.
|
Cursor |
cursor(int index)
Returns a
Cursor at the specified row index. |
DateColumn |
dateColumn(int columnIndex)
Returns the
DateColumn at the specified index. |
DateColumn |
dateColumn(String columnName)
Returns the specified
DateColumn |
DateTimeColumn |
dateTimeColumn(int columnIndex)
Returns the
DateTimeColumn at the specified index. |
DateTimeColumn |
dateTimeColumn(String columnName)
Returns the specified
DateTimeColumn |
DecimalColumn |
decimalColumn(int columnIndex)
Returns the
DecimalColumn at the specified index. |
DecimalColumn |
decimalColumn(String columnName)
Returns the specified
DecimalColumn |
<T> Column<T> |
deriveColumn(ColumnType<T> type,
Function<Row,T> function)
Derive a new
Column from the rows of this dataframe. |
BooleanColumn |
deriveColumn(Predicate<Row> function)
Derive a new
BooleanColumn from the rows of this dataframe. |
DoubleColumn |
deriveColumn(ToDoubleFunction<Row> function)
Derive a new
DoubleColumn from the rows of this dataframe. |
FloatColumn |
deriveColumn(ToFloatFunction<Row> function)
Derive a new
FloatColumn from the rows of this dataframe. |
IntColumn |
deriveColumn(ToIntFunction<Row> function)
Derive a new
IntColumn from the rows of this dataframe. |
LongColumn |
deriveColumn(ToLongFunction<Row> function)
Derive a new
LongColumn from the rows of this dataframe. |
DoubleColumn |
doubleColumn(int columnIndex)
Returns the
DoubleColumn at the specified index. |
DoubleColumn |
doubleColumn(String columnName)
Returns the specified
DoubleColumn |
DataFrame |
dropColumns(Collection<String> columnNames)
Returns a new dataframe which excludes the specified columns.
|
DataFrame |
dropColumns(int... columnIndices)
Returns a new dataframe which excludes the specified columns.
|
DataFrame |
dropColumns(String... columnNames)
Returns a new dataframe which excludes the specified columns.
|
DateSeries |
empty()
Returns an empty
DateSeries. |
boolean |
equals(DataFrame df,
boolean dataOnly)
Tests this DataFrame against the specified one for equality.
|
boolean |
equals(Object o) |
DateSeries |
filter(Predicate<Row> criteria)
Returns a dataframe containing the rows which pass the specified
Predicate. |
DataFrame |
filterNulls()
Returns a dataframe containing the rows which do not contain any null values.
|
FloatColumn |
floatColumn(int columnIndex)
Returns the
FloatColumn at the specified index. |
FloatColumn |
floatColumn(String columnName)
Returns the specified
FloatColumn |
Row |
get(int rowIndex) |
<T> T |
get(int rowIndex,
int columnIndex)
Returns the value for the specified row in the specified
Column. |
<T> T |
get(int rowIndex,
String columnName)
Returns the value for the specified row in the specified
Column. |
BigDecimal |
getBigDecimal(int rowIndex,
int columnIndex)
Returns the value for the specified row in the specified
DecimalColumn. |
BigDecimal |
getBigDecimal(int rowIndex,
String columnName)
Returns the value for the specified row in the specified
DecimalColumn. |
boolean |
getBoolean(int rowIndex,
int columnIndex)
boolean primitive specialization of DataFrame.get(int,int). |
boolean |
getBoolean(int rowIndex,
String columnName)
boolean primitive specialization of DataFrame.get(int,String). |
LocalDate |
getDate(int rowIndex,
int columnIndex)
Returns the value for the specified row in the specified
DateColumn. |
LocalDate |
getDate(int rowIndex,
String columnName)
Returns the value for the specified row in the specified
DateColumn. |
LocalDateTime |
getDateTime(int rowIndex,
int columnIndex)
Returns the value for the specified row in the specified
DateTimeColumn. |
LocalDateTime |
getDateTime(int rowIndex,
String columnName)
Returns the value for the specified row in the specified
DateTimeColumn. |
double |
getDouble(int rowIndex,
int columnIndex)
double primitive specialization of DataFrame.get(int,int). |
double |
getDouble(int rowIndex,
String columnName)
double primitive specialization of DataFrame.get(int,String). |
float |
getFloat(int rowIndex,
int columnIndex)
float primitive specialization of DataFrame.get(int,int). |
float |
getFloat(int rowIndex,
String columnName)
float primitive specialization of DataFrame.get(int,String). |
int |
getInt(int rowIndex,
int columnIndex)
int primitive specialization of DataFrame.get(int,int). |
int |
getInt(int rowIndex,
String columnName)
int primitive specialization of DataFrame.get(int,String). |
long |
getLong(int rowIndex,
int columnIndex)
long primitive specialization of DataFrame.get(int,int). |
long |
getLong(int rowIndex,
String columnName)
long primitive specialization of DataFrame.get(int,String). |
short |
getShort(int rowIndex,
int columnIndex)
short primitive specialization of DataFrame.get(int,int). |
short |
getShort(int rowIndex,
String columnName)
short primitive specialization of DataFrame.get(int,String). |
String |
getString(int rowIndex,
int columnIndex)
Returns the value for the specified row in the specified
StringColumn. |
String |
getString(int rowIndex,
String columnName)
Returns the value for the specified row in the specified
StringColumn. |
boolean |
hasKeyColumn()
Returns true if this dataframe has a key column.
|
DateSeries |
head()
Returns a
DateSeries containing the first 10 points from this time
series, or this time series if it contains fewer than 10 points. |
DateSeries |
head(int count)
Returns a dataframe containing the first
count rows from this
dataframe, or this dataframe if it contains fewer than count rows. |
DateSeries |
headTo(LocalDate toKey)
Returns a
DateSeries containing the points with dates strictly less
than toKey. |
DataFrame |
headTo(Object toKey)
Returns a dataframe containing the rows whose key column values are strictly
less than
toKey. |
DataFrame |
indexOrganize(int columnIndex)
Returns a new dataframe with rows sorted by the specified column.
|
DataFrame |
indexOrganize(String columnName)
Returns a new dataframe with rows sorted by the specified column.
|
IntColumn |
intColumn(int columnIndex)
Returns the
IntColumn at the specified index. |
IntColumn |
intColumn(String columnName)
Returns the specified
IntColumn |
boolean |
isNull(int rowIndex,
int columnIndex)
Returns true if the value is null in the specified
Column at the
specified row index. |
boolean |
isNull(int rowIndex,
String columnName)
Returns true if the value is null in the specified
Column at the
specified row index. |
DataFrame |
join(DataFrame df)
Perform a one-to-one inner join on this (left) dataframe with the specified
(right) dataframe by their key columns.
|
DataFrame |
join(DataFrame df,
String[] leftColumnNames,
String[] rightColumnNames)
Perform a one-to-many inner join on this (left) dataframe with the specified
(right) dataframe by building a hashtable index on the specified left
columns.
|
DataFrame |
joinLeftOneToMany(DataFrame df,
String rightColumnName)
Perform a one-to-many left join on this (left) dataframe with the specified
(right) dataframe using the key column from the left dataframe.
|
DataFrame |
joinManyToOne(DataFrame df,
String columnName)
Perform a many-to-one inner join on this (left) dataframe with the specified
(right) dataframe using the key column from the right dataframe.
|
DataFrame |
joinOneToMany(DataFrame df,
String columnName)
Perform a one-to-many inner join on this (left) dataframe with the specified
(right) dataframe using the key column from the left dataframe.
|
Integer |
keyColumnIndex()
Returns the index of the key column, or null if no key column has been
specified.
|
String |
keyColumnName()
Returns the key column name, or null if no key column has been specified.
|
ColumnType |
keyColumnType()
Returns the key
column type, or null if no key column has
been specified. |
LongColumn |
longColumn(int columnIndex)
Returns the
LongColumn at the specified index. |
LongColumn |
longColumn(String columnName)
Returns the specified
LongColumn |
DateSeries |
sampleN(int sampleSize)
Returns a dataframe containing
sampleSize rows selected at random. |
DateSeries |
sampleX(double proportion)
Returns a dataframe containing
size()*proportion rows selected at
random. |
DataFrame |
selectColumns(int... columnIndices)
Returns a new dataframe which contains only the specified columns, in the
specified order.
|
DataFrame |
selectColumns(List<String> columnNames)
Returns a new dataframe which contains only the specified columns, in the
specified order.
|
DataFrame |
selectColumns(String... columnNames)
Returns a new dataframe which contains only the specified columns, in the
specified order.
|
ShortColumn |
shortColumn(int columnIndex)
Returns the
ShortColumn at the specified index. |
ShortColumn |
shortColumn(String columnName)
Returns the specified
ShortColumn |
int |
size() |
StringColumn |
stringColumn(int columnIndex)
Returns the
StringColumn at the specified index. |
StringColumn |
stringColumn(String columnName)
Returns the specified
StringColumn |
DataFrame |
subFrame(int fromIndex,
int toIndex)
Returns a dataframe containing the rows between the specified
fromIndex, inclusive, and toIndex, exclusive (if
fromIndex and toIndex are equal, the returned dataframe is
empty).
|
DataFrame |
subFrameByValue(Object fromKey,
boolean fromInclusive,
Object toKey,
boolean toInclusive)
Returns a dataframe containing the rows whose key column values are between
fromKey and toKey. |
DateSeries |
subSeries(int fromIndex,
int toIndex)
Returns a
DateSeries containing the points between the specified
fromIndex, inclusive, and toIndex, exclusive (if
fromIndex and toIndex are equal, the returned time series
is empty). |
DateSeries |
subSeries(LocalDate fromKey,
boolean fromInclusive,
LocalDate toKey,
boolean toInclusive)
|
DateSeries |
subSeries(LocalDate fromKey,
LocalDate toKey)
Returns a
DateSeries containing the points with dates are greater
than or equal to fromKey and strictly less than toKey. |
DateSeries |
tail()
Returns a
DateSeries containing the last 10 points from this time
series, or this time series if it contains fewer than 10 points. |
DateSeries |
tail(int count)
Returns a dataframe containing the last
count rows from this
dataframe, or this dataframe if it contains fewer than count rows. |
DateSeries |
tailFrom(LocalDate fromKey)
Returns a
DateSeries containing the points with dates greater than or
equal to fromKey. |
DataFrame |
tailFrom(Object fromKey)
Returns a dataframe containing the rows whose key column values are greater
than or equal to
fromKey. |
DateSeries |
toDateSeries(int columnIndex)
Returns a
DateSeries using the key column from this dataframe as the
date column in the time series, and using the specified column as the values
column in the time series. |
DateSeries |
toDateSeries(String columnName)
Returns a
DateSeries using the key column from this dataframe as the
date column in the time series, and using the specified column as the values
column in the time series. |
<K,V> Map<K,V> |
toMap(int columnIndex)
Returns a map keyed by the elements in the key column, with values from the
column at the specified index.
|
<K,V> Map<K,V> |
toMap(String columnName)
Returns a map keyed by the elements in the key column, with values from the
column at the specified index.
|
String |
toString() |
DateSeries |
transform(DateSeries ts,
DoubleBinaryOperator op)
Joins this time series with the specifies series, and combines their values
point-wise using the specified operation.
|
DateSeries |
transform(DoubleUnaryOperator op)
Returns a new time series where the values have been transformed by the
provided operation.
|
DataFrame |
withColumn(String columnName,
Column<?> column)
Returns a new dataframe which is a shallow copy of this one, but including
the specified column and column name.
|
DataFrame |
withColumns(DataFrame df)
Returns a new dataframe which is a shallow copy of this one, but including
the columns and column names from the provided dataframe.
|
DataFrame |
withColumns(LinkedHashMap<String,Column<?>> columns)
Returns a new dataframe which is a shallow copy of this one, but including
the specified columns and column names.
|
DataFrame |
withColumns(String[] columnNames,
Column<?>[] columns)
Returns a new dataframe which is a shallow copy of this one, but including
the specified columns and column names.
|
DataFrame |
withKeyColumn(int columnIndex)
Returns a new dataframe which is a shallow copy of this one, but with the key
column set to the specified column.
|
DataFrame |
withKeyColumn(String columnName)
Returns a new dataframe which is a shallow copy of this one, but with the key
column set to the specified column.
|
void |
writeCsvTo(File file)
Save this dataframe to an RFC
4180 compliant CSV file, encoded with UTF-8.
|
void |
writeCsvTo(OutputStream os)
Write this dataframe as an RFC
4180 compliant CSV to the specified
OutputStream, encoded with
UTF-8. |
void |
writeTo(File file)
Saves this dataframe to a file in a binary format.
|
void |
writeTo(PreparedStatement ps,
WriteToDbConfig config)
Writes this dataframe to the specified
PreparedStatement using the
specified configuration. |
void |
writeTo(WritableByteChannel channel)
Writes this dataframe to the specified
WritableByteChannel. |
int |
yyyymmdd(int rowIndex,
int columnIndex)
Returns the
yyyymmdd date for the specified row in the specified
DateColumn. |
int |
yyyymmdd(int rowIndex,
String columnName)
Returns the
yyyymmdd date for the specified row in the specified
DateColumn. |
add, add, addAll, clear, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDate, getValue, toDateSeries, toDateSeries, yyyymmddappend, append, booleanColumn, booleanColumn, column, column, columnCount, columnIndex, columnMap, columnName, columnNames, columns, columnType, columnType, columnTypes, copy, cursor, cursor, dateColumn, dateColumn, dateTimeColumn, dateTimeColumn, decimalColumn, decimalColumn, deriveColumn, deriveColumn, deriveColumn, deriveColumn, deriveColumn, deriveColumn, doubleColumn, doubleColumn, dropColumns, dropColumns, dropColumns, equals, filterNulls, floatColumn, floatColumn, get, get, getBigDecimal, getBigDecimal, getBoolean, getBoolean, getDate, getDate, getDateTime, getDateTime, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getOrDefaultDouble, getOrDefaultDouble, getOrDefaultFloat, getOrDefaultFloat, getOrDefaultInt, getOrDefaultInt, getOrDefaultLong, getOrDefaultLong, getOrDefaultShort, getOrDefaultShort, getShort, getShort, getString, getString, hasKeyColumn, headTo, indexOrganize, indexOrganize, intColumn, intColumn, isNull, isNull, join, join, joinLeftOneToMany, joinManyToOne, joinOneToMany, keyColumnIndex, keyColumnName, keyColumnType, longColumn, longColumn, selectColumns, selectColumns, selectColumns, shortColumn, shortColumn, spliterator, stringColumn, stringColumn, subFrame, subFrameByValue, subFrameByValue, tailFrom, toMap, toMap, withColumn, withColumns, withColumns, withColumns, withKeyColumn, withKeyColumn, writeCsvTo, writeCsvTo, writeTo, writeTo, writeTo, writeTo, yyyymmdd, yyyymmddadd, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, subList, toArray, toArrayparallelStream, removeIf, streampublic DateSeries transform(DoubleUnaryOperator op)
DateSeriesThe resulting time series will have the same column names.
transform in interface DateSeriesop - - the operation used to transform the valuespublic DateSeries transform(DateSeries ts, DoubleBinaryOperator op)
DateSeriesThe resulting time series will have the same column names as this one.
transform in interface DateSeriests - - the series to be joined with this oneop - - the operation used to combine the valuespublic Map<LocalDate,Double> asMap()
DateSeriesMap view of this time series.asMap in interface DateSeriesMap view of this time series.public DateSeries sampleN(int sampleSize)
DataFramesampleSize rows selected at random.
The rows in the resulting dataframe will be in the same order as in this one.sampleN in interface DataFramesampleN in interface DateSeriessampleSize - - the number of rows to sample from this dataframesampleSize rows selected at random.public DateSeries sampleX(double proportion)
DataFramesize()*proportion rows selected at
random. The rows in the resulting dataframe will be in the same order as in
this one.sampleX in interface DataFramesampleX in interface DateSeriesproportion - - a number between 0.0 and 1.0 inclusivesize()*proportion rows selected at
random.public DateSeries filter(Predicate<Row> criteria)
DataFramePredicate.filter in interface DataFramefilter in interface DateSeriescriteria - - the Predicate used to filter the rows in this
dataframePredicate.public DateSeries append(DateSeries df)
DateSeriesDateSeries to this one by calling
Column.append(Column) on both the key and value columns, and keeping
the meta-data from this dataframe.append in interface DateSeriesdf - - the time series to be appended to this oneDateSeries resulting from appended the specified time
series to this one.public DateSeries head(int count)
DataFramecount rows from this
dataframe, or this dataframe if it contains fewer than count rows.head in interface DataFramehead in interface DateSeriescount - - number of rows to return from the "top" or "head" of this
dataframe.count rows from this
dataframe.public DateSeries empty()
DateSeriesDateSeries. The resulting time series will have the
same meta-data (column names) as this one, but the key and value columns will
be empty.empty in interface DataFrameempty in interface DateSeriesDateSeries with the same meta-data as this one.public DateSeries head()
DateSeriesDateSeries containing the first 10 points from this time
series, or this time series if it contains fewer than 10 points.head in interface DataFramehead in interface DateSeriesDateSeries containing the first 10 points from this time
series.public DateSeries tail(int count)
DataFramecount rows from this
dataframe, or this dataframe if it contains fewer than count rows.tail in interface DataFrametail in interface DateSeriescount - - number of rows to return from the "end" or "tail" of this
dataframe.count rows from this
dataframe.public DateSeries tail()
DateSeriesDateSeries containing the last 10 points from this time
series, or this time series if it contains fewer than 10 points.tail in interface DataFrametail in interface DateSeriesDateSeries containing the last 10 points from this time
series.public DateSeries subSeries(int fromIndex, int toIndex)
DateSeriesDateSeries containing the points between the specified
fromIndex, inclusive, and toIndex, exclusive (if
fromIndex and toIndex are equal, the returned time series
is empty).subSeries in interface DateSeriesfromIndex - - index of the lowest point (inclusive)toIndex - - index of the highest point (exclusive)DateSeries containing the points between the specified
fromIndex, inclusive, and toIndex, exclusivepublic DateSeries headTo(LocalDate toKey)
DateSeriesDateSeries containing the points with dates strictly less
than toKey.headTo in interface DateSeriestoKey - high endpoint (exclusive) of the dates in the returned time
seriestoKey.public DateSeries tailFrom(LocalDate fromKey)
DateSeriesDateSeries containing the points with dates greater than or
equal to fromKey.tailFrom in interface DateSeriesfromKey - low endpoint (inclusive) of the dates in the returned time
seriesfromKey.public DateSeries subSeries(LocalDate fromKey, LocalDate toKey)
DateSeriesDateSeries containing the points with dates are greater
than or equal to fromKey and strictly less than toKey.subSeries in interface DateSeriesfromKey - low endpoint (inclusive) of the dates in the returned time
seriestoKey - high endpoint (exclusive) of the dates in the returned time
seriesfromKey and strictly less than toKey.public DateSeries subSeries(LocalDate fromKey, boolean fromInclusive, LocalDate toKey, boolean toInclusive)
DateSeriesDateSeries containing the points with dates between
fromKey and toKey. If fromKey and toKey are
equal, the resulting time series is empty unless fromInclusive and toInclusive are both true.subSeries in interface DateSeriesfromKey - low endpoint (inclusive) of the dates in the returned
time seriesfromInclusive - true if the low endpoint is to be included in the resulttoKey - high endpoint (exclusive) of the dates in the returned
time seriestoInclusive - true if the high endpoint is to be included in the
resultfromKey and toKey.public String toString()
toString in class AbstractCollection<Row>public int size()
size in interface Collection<Row>size in interface List<Row>size in class AbstractCollection<Row>public Row get(int rowIndex)
public boolean equals(DataFrame df, boolean dataOnly)
DataFramedataOnly is true, otherwise compares column names
and DataFrame.keyColumnIndex() as well.equals in interface DataFramedf - - the dataframe to compare againstdataOnly - - only compares column data if true, otherwise compares
column names and DataFrame.keyColumnIndex() as welldataOnly
is true or the column names and DataFrame.keyColumnIndex() are the
same as well.public boolean equals(Object o)
equals in interface Collection<Row>equals in interface List<Row>equals in class AbstractList<Row>public DataFrame copy()
DataFramepublic Cursor cursor(int index)
DataFrameCursor at the specified row index.public <K,V> Map<K,V> toMap(int columnIndex)
DataFrametoMap in interface DataFrameK - - the key type. Must match the key column type.V - - the value type. Must match the specified column type.columnIndex - - index of a column in this dataframepublic <K,V> Map<K,V> toMap(String columnName)
DataFrametoMap in interface DataFrameK - - the key type. Must match the key column type.V - - the value type. Must match the specified column type.columnName - - name of a column in this dataframepublic DateSeries toDateSeries(int columnIndex)
DataFrameDateSeries using the key column from this dataframe as the
date column in the time series, and using the specified column as the values
column in the time series.toDateSeries in interface DataFramecolumnIndex - - index of a non-null DoubleColumn in this
dataframeDateSeries built from columns in this dataframe.public DateSeries toDateSeries(String columnName)
DataFrameDateSeries using the key column from this dataframe as the
date column in the time series, and using the specified column as the values
column in the time series.toDateSeries in interface DataFramecolumnName - - name of a non-null DoubleColumn in this dataframeDateSeries built from columns in this dataframe.public boolean hasKeyColumn()
DataFramehasKeyColumn in interface DataFramepublic Integer keyColumnIndex()
DataFramekeyColumnIndex in interface DataFramepublic String keyColumnName()
DataFramekeyColumnName in interface DataFramepublic ColumnType keyColumnType()
DataFramecolumn type, or null if no key column has
been specified.keyColumnType in interface DataFramepublic DataFrame withKeyColumn(int columnIndex)
DataFramewithKeyColumn in interface DataFramecolumnIndex - - the key column indexpublic DataFrame withKeyColumn(String columnName)
DataFramewithKeyColumn in interface DataFramecolumnName - - name of the column in this dataframepublic DataFrame indexOrganize(int columnIndex)
DataFrameindexOrganize in interface DataFramecolumnIndex - - the key column indexpublic DataFrame indexOrganize(String columnName)
DataFrameindexOrganize in interface DataFramecolumnName - - name of the column in this dataframepublic int columnCount()
DataFramecolumnCount in interface DataFramepublic int columnIndex(String columnName)
DataFramecolumnIndex in interface DataFramecolumnName - - name of the column in this dataframepublic String columnName(int columnIndex)
DataFramecolumnName in interface DataFramecolumnIndex - - the column indexpublic ColumnType columnType(int columnIndex)
DataFramecolumn type at the specified index.columnType in interface DataFramecolumnIndex - - the column indexpublic ColumnType columnType(String columnName)
DataFramecolumn type at the specified index.columnType in interface DataFramecolumnName - - name of the column in this dataframepublic LinkedHashMap<String,Column<?>> columnMap()
DataFramepublic List<Column<?>> columns()
DataFramepublic List<String> columnNames()
DataFramecolumnNames in interface DataFramepublic List<ColumnType<?>> columnTypes()
DataFramecolumnTypes in interface DataFramepublic DataFrame withColumn(String columnName, Column<?> column)
DataFramewithColumn in interface DataFramecolumnName - - name of the column to be added or replacedcolumn - - the columnpublic DataFrame withColumns(String[] columnNames, Column<?>[] columns)
DataFramewithColumns in interface DataFramecolumnNames - - names of the columns to be added or replacedcolumns - - the columnspublic DataFrame withColumns(LinkedHashMap<String,Column<?>> columns)
DataFramewithColumns in interface DataFramecolumns - - an ordered list of entries containing columns and column
namespublic DataFrame withColumns(DataFrame df)
DataFramewithColumns in interface DataFramedf - - a dataframe whose columns will be included in the resultpublic DataFrame selectColumns(List<String> columnNames)
DataFrameselectColumns in interface DataFramecolumnNames - - the columns names to be included in the resultpublic DataFrame selectColumns(String... columnNames)
DataFrameselectColumns in interface DataFramecolumnNames - - the columns names to be included in the resultpublic DataFrame selectColumns(int... columnIndices)
DataFrameselectColumns in interface DataFramecolumnIndices - - the columns to be included in the resultpublic DataFrame dropColumns(Collection<String> columnNames)
DataFramedropColumns in interface DataFramecolumnNames - - the columns names to be excluded from the resultpublic DataFrame dropColumns(String... columnNames)
DataFramedropColumns in interface DataFramecolumnNames - - the columns names to be excluded from the resultpublic DataFrame dropColumns(int... columnIndices)
DataFramedropColumns in interface DataFramecolumnIndices - - the columns to be excluded from the resultpublic <T> Column<T> column(int columnIndex)
DataFrameColumn at the specified index.public StringColumn stringColumn(int columnIndex)
DataFrameStringColumn at the specified index.stringColumn in interface DataFramecolumnIndex - - index of the columnpublic DecimalColumn decimalColumn(int columnIndex)
DataFrameDecimalColumn at the specified index.decimalColumn in interface DataFramecolumnIndex - - index of the columnpublic BooleanColumn booleanColumn(int columnIndex)
DataFrameBooleanColumn at the specified index.booleanColumn in interface DataFramecolumnIndex - - index of the columnpublic IntColumn intColumn(int columnIndex)
DataFrameIntColumn at the specified index.public LongColumn longColumn(int columnIndex)
DataFrameLongColumn at the specified index.longColumn in interface DataFramecolumnIndex - - index of the columnpublic ShortColumn shortColumn(int columnIndex)
DataFrameShortColumn at the specified index.shortColumn in interface DataFramecolumnIndex - - index of the columnpublic DoubleColumn doubleColumn(int columnIndex)
DataFrameDoubleColumn at the specified index.doubleColumn in interface DataFramecolumnIndex - - index of the columnpublic FloatColumn floatColumn(int columnIndex)
DataFrameFloatColumn at the specified index.floatColumn in interface DataFramecolumnIndex - - index of the columnpublic DateColumn dateColumn(int columnIndex)
DataFrameDateColumn at the specified index.dateColumn in interface DataFramecolumnIndex - - index of the columnpublic DateTimeColumn dateTimeColumn(int columnIndex)
DataFrameDateTimeColumn at the specified index.dateTimeColumn in interface DataFramecolumnIndex - - index of the columnpublic <T> Column<T> column(String columnName)
DataFrameColumnpublic StringColumn stringColumn(String columnName)
DataFrameStringColumnstringColumn in interface DataFramecolumnName - - column namepublic DecimalColumn decimalColumn(String columnName)
DataFrameDecimalColumndecimalColumn in interface DataFramecolumnName - - column namepublic BooleanColumn booleanColumn(String columnName)
DataFrameBooleanColumnbooleanColumn in interface DataFramecolumnName - - column namepublic IntColumn intColumn(String columnName)
DataFrameIntColumnpublic LongColumn longColumn(String columnName)
DataFrameLongColumnlongColumn in interface DataFramecolumnName - - column namepublic ShortColumn shortColumn(String columnName)
DataFrameShortColumnshortColumn in interface DataFramecolumnName - - column namepublic DoubleColumn doubleColumn(String columnName)
DataFrameDoubleColumndoubleColumn in interface DataFramecolumnName - - column namepublic FloatColumn floatColumn(String columnName)
DataFrameFloatColumnfloatColumn in interface DataFramecolumnName - - column namepublic DateColumn dateColumn(String columnName)
DataFrameDateColumndateColumn in interface DataFramecolumnName - - column namepublic DateTimeColumn dateTimeColumn(String columnName)
DataFrameDateTimeColumndateTimeColumn in interface DataFramecolumnName - - column namepublic <T> Column<T> deriveColumn(ColumnType<T> type, Function<Row,T> function)
DataFrameColumn from the rows of this dataframe. The new column
will have the same size as this dataframe, and each element will have been
derived from the corresponding row.deriveColumn in interface DataFrameT - - the return type. Must be compatible with the column type.
No attempt is made to convert between types beyond a cast.type - - the new column's typefunction - - the function used to compute column elements from dataframe
rowspublic IntColumn deriveColumn(ToIntFunction<Row> function)
DataFrameIntColumn from the rows of this dataframe. The new
column will have the same size as this dataframe, and each element will have
been derived from the corresponding row.deriveColumn in interface DataFramefunction - - the function used to compute column elements from dataframe
rowspublic LongColumn deriveColumn(ToLongFunction<Row> function)
DataFrameLongColumn from the rows of this dataframe. The new
column will have the same size as this dataframe, and each element will have
been derived from the corresponding row.deriveColumn in interface DataFramefunction - - the function used to compute column elements from dataframe
rowspublic DoubleColumn deriveColumn(ToDoubleFunction<Row> function)
DataFrameDoubleColumn from the rows of this dataframe. The new
column will have the same size as this dataframe, and each element will have
been derived from the corresponding row.deriveColumn in interface DataFramefunction - - the function used to compute column elements from dataframe
rowspublic FloatColumn deriveColumn(ToFloatFunction<Row> function)
DataFrameFloatColumn from the rows of this dataframe. The new
column will have the same size as this dataframe, and each element will have
been derived from the corresponding row.deriveColumn in interface DataFramefunction - - the function used to compute column elements from dataframe
rowspublic BooleanColumn deriveColumn(Predicate<Row> function)
DataFrameBooleanColumn from the rows of this dataframe. The new
column will have the same size as this dataframe, and each element will have
been derived from the corresponding row.deriveColumn in interface DataFramefunction - - the function used to compute column elements from dataframe
rowspublic DataFrame subFrame(int fromIndex, int toIndex)
DataFramepublic DataFrame headTo(Object toKey)
DataFrametoKey.public DataFrame tailFrom(Object fromKey)
DataFramefromKey.public DataFrame subFrameByValue(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive)
DataFramefromKey and toKey. If fromKey and toKey are
equal, the resulting dataframe is empty unless fromInclusive and toInclusive are both true.subFrameByValue in interface DataFramefromKey - low endpoint of the key column values in the returned
dataframefromInclusive - true if the low endpoint is to be included in the resulttoKey - high endpoint of the key column values in the returned
dataframetoInclusive - true if the high endpoint is to be included in the
resultfromKey and toKey.public DataFrame filterNulls()
DataFramefilterNulls in interface DataFramepublic DataFrame append(DataFrame df)
DataFrameColumn.append(Column) on each pair of columns, and keeping the
meta-data from this dataframe.public DataFrame append(DataFrame df, boolean coerce)
DataFrameColumn.append(Column,boolean) on each pair of columns, and keeping
the meta-data from this dataframe.public DataFrame join(DataFrame df)
DataFrame
If the left dataframe has N columns and the right has M
columns then the resulting dataframe will have N + M - 1 columns,
starting with all N columns from the left dataframe, followed by the columns
from the right dataframe excluding the right key column. If the right
dataframe has any column names in common with the left, the duplicate right
column names will have a suffix appended to them in the result.
If the left dataframe has S rows and the right has T rows
then this join operation will use O(S + T) space and time. The space
overhead is approximately S + T bits. The result will contain at most
min(S, T) rows, and will be empty if the two key columns do not have
any elements in common.
public DataFrame joinOneToMany(DataFrame df, String columnName)
DataFrame
If the left dataframe has N columns and the right has M
columns then the resulting dataframe will have N + M - 1 columns,
starting with all N columns from the left dataframe, followed by the columns
from the right dataframe excluding the specified non-index column. If the
right dataframe has any column names in common with the left, the duplicate
right column names will have a suffix appended to them in the result.
If the left dataframe has S rows and the right has T rows
then this join operation will use O(T) space and run in
O(T*log(S)) time. The space overhead is approximately
T*(4 bytes + 1 bit).
joinOneToMany in interface DataFramedf - - the right dataframe to be joined with this left onecolumnName - - name of the column in the right dataframe which will
be matched against the key column from the left
dataframepublic DataFrame joinManyToOne(DataFrame df, String columnName)
DataFrame
If the left dataframe has N columns and the right has M
columns then the resulting dataframe will have N + M - 1 columns,
starting with all N columns from the left dataframe, followed by the columns
from the right dataframe excluding the key column. If the right dataframe has
any column names in common with the left, the duplicate right column names
will have a suffix appended to them in the result.
If the left dataframe has S rows and the right has T rows
then this join operation will use O(S) space and run in
O(S*log(T)) time. The space overhead is approximately
S*(4 bytes + 1 bit).
joinManyToOne in interface DataFramedf - - the right dataframe to be joined with this left onecolumnName - - name of the column in the left dataframe which will
be matched against the key column from the right
dataframepublic DataFrame joinLeftOneToMany(DataFrame df, String rightColumnName)
DataFramenull values filled in for the
columns from the right dataframe.
If the left dataframe has N columns and the right has M
columns then the resulting dataframe will have N + M - 1 columns,
starting with all N columns from the left dataframe, followed by the columns
from the right dataframe excluding the specified non-index column. If the
right dataframe has any column names in common with the left, the duplicate
right column names will have a suffix appended to them in the result.
If the left dataframe has S rows and the right has T rows
then this join operation will use O(S + T) space and run in
O(T*log(S)) time. The space overhead is approximately S bits, plus
T*(4 bytes + 1 bit).
joinLeftOneToMany in interface DataFramedf - - the right dataframe to be joined with this left onerightColumnName - - name of the column in the right dataframe which will
be matched against the key column from the left
dataframepublic DataFrame join(DataFrame df, String[] leftColumnNames, String[] rightColumnNames)
DataFrame
If the left dataframe has N columns, the right has M columns,
and the hashtable index has H columns then the resulting dataframe
will have N + M - H columns, starting with all N columns from the
left dataframe, followed by the columns from the right dataframe excluding
the hashtable index columns. If the right dataframe has any column names in
common with the left, the duplicate right column names will have a suffix
appended to them in the result.
If the left dataframe has S rows and the right has T rows
then this join operation will use O(S + T) space and time. The space
overhead is approximately T bits, plus the space required by an
<Integer,Integer> HashMap with S entries,
plus an additional S*8 bytes.
join in interface DataFramedf - - the right dataframe to be joined with this left oneleftColumnNames - - names of columns in this (left) dataframe, which
taken together form a unique indexrightColumnNames - - corresponding columns in the specified (right)
dataframepublic void writeTo(File file) throws IOException
DataFramewriteTo in interface DataFramefile - - the file to be (over)written.IOException - if some I/O error occurspublic void writeTo(WritableByteChannel channel) throws IOException
DataFrameWritableByteChannel.writeTo in interface DataFramechannel - - the channel to be written toIOException - if some I/O error occurspublic void writeCsvTo(File file) throws IOException
DataFrame
Individual elements are written using their toString methods.
null values are written as empty fields. For column type STRING,
empty strings are written as "".
writeCsvTo in interface DataFramefile - - the file to be (over)written.IOException - if some I/O error occurspublic void writeCsvTo(OutputStream os) throws IOException
DataFrameOutputStream, encoded with
UTF-8.
Individual elements are written using their toString methods.
null values are written as empty fields. For column type STRING,
empty strings are written as "".
writeCsvTo in interface DataFrameos - - the output stream to be written to. OutputStream will be closed
by this method.IOException - if some I/O error occurspublic void writeTo(PreparedStatement ps, WriteToDbConfig config) throws SQLException
DataFramePreparedStatement using the
specified configuration.
The connection returned by Statement.getConnection() must
have autocommit turned off.
writeTo in interface DataFrameps - - the PreparedStatement to write rows toconfig - - the configuration for writing this
dataframe to the PreparedStatement.SQLException - if some SQL or database error occursWriteToDbConfigpublic boolean isNull(int rowIndex,
int columnIndex)
DataFrameColumn at the
specified row index.public boolean isNull(int rowIndex,
String columnName)
DataFrameColumn at the
specified row index.public <T> T get(int rowIndex,
int columnIndex)
DataFrameColumn.get in interface DataFrameT - - the return type. Must be compatible with the column
type. No attempt is made to convert between types beyond a
cast.rowIndex - - the row indexcolumnIndex - - index of the column in this DataFrame.Column.public <T> T get(int rowIndex,
String columnName)
DataFrameColumn.get in interface DataFrameT - - the return type. Must be compatible with the column type.
No attempt is made to convert between types beyond a cast.rowIndex - - the row indexcolumnName - - name of the column in this DataFrame.Column.public String getString(int rowIndex, int columnIndex)
DataFrameStringColumn.public String getString(int rowIndex, String columnName)
DataFrameStringColumn.public BigDecimal getBigDecimal(int rowIndex, int columnIndex)
DataFrameDecimalColumn.getBigDecimal in interface DataFramerowIndex - - the row indexcolumnIndex - - index of the column in this DataFrame.DecimalColumn.public BigDecimal getBigDecimal(int rowIndex, String columnName)
DataFrameDecimalColumn.getBigDecimal in interface DataFramerowIndex - - the row indexcolumnName - - name of the column in this DataFrame.DecimalColumn.public boolean getBoolean(int rowIndex,
int columnIndex)
DataFrameboolean primitive specialization of DataFrame.get(int,int).getBoolean in interface DataFramerowIndex - - the row indexcolumnIndex - - index of the column in this DataFrame.BooleanColumn.public boolean getBoolean(int rowIndex,
String columnName)
DataFrameboolean primitive specialization of DataFrame.get(int,String).getBoolean in interface DataFramerowIndex - - the row indexcolumnName - - name of the column in this DataFrame.BooleanColumn.public int getInt(int rowIndex,
int columnIndex)
DataFrameint primitive specialization of DataFrame.get(int,int).public int getInt(int rowIndex,
String columnName)
DataFrameint primitive specialization of DataFrame.get(int,String).public long getLong(int rowIndex,
int columnIndex)
DataFramelong primitive specialization of DataFrame.get(int,int).public long getLong(int rowIndex,
String columnName)
DataFramelong primitive specialization of DataFrame.get(int,String).public short getShort(int rowIndex,
int columnIndex)
DataFrameshort primitive specialization of DataFrame.get(int,int).public short getShort(int rowIndex,
String columnName)
DataFrameshort primitive specialization of DataFrame.get(int,String).public double getDouble(int rowIndex,
int columnIndex)
DataFramedouble primitive specialization of DataFrame.get(int,int).public double getDouble(int rowIndex,
String columnName)
DataFramedouble primitive specialization of DataFrame.get(int,String).public float getFloat(int rowIndex,
int columnIndex)
DataFramefloat primitive specialization of DataFrame.get(int,int).public float getFloat(int rowIndex,
String columnName)
DataFramefloat primitive specialization of DataFrame.get(int,String).public LocalDate getDate(int rowIndex, int columnIndex)
DataFrameDateColumn.public LocalDate getDate(int rowIndex, String columnName)
DataFrameDateColumn.public int yyyymmdd(int rowIndex,
int columnIndex)
DataFrameyyyymmdd date for the specified row in the specified
DateColumn.public int yyyymmdd(int rowIndex,
String columnName)
DataFrameyyyymmdd date for the specified row in the specified
DateColumn.public LocalDateTime getDateTime(int rowIndex, int columnIndex)
DataFrameDateTimeColumn.getDateTime in interface DataFramerowIndex - - the row indexcolumnIndex - - index of the column in this DataFrame.DateTimeColumn.public LocalDateTime getDateTime(int rowIndex, String columnName)
DataFrameDateTimeColumn.getDateTime in interface DataFramerowIndex - - the row indexcolumnName - - name of the column in this DataFrame.DateTimeColumn.Copyright © 2020. All rights reserved.