public class TableTools extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NULL_STRING |
Constructor and Description |
---|
TableTools() |
Modifier and Type | Method and Description |
---|---|
static ColumnHolder |
byteCol(String name,
byte... data)
Returns a ColumnHolder of type byte that can be used when creating in-memory tables.
|
static ColumnHolder |
charCol(String name,
char... data)
Returns a ColumnHolder of type char that can be used when creating in-memory tables.
|
static <T> ColumnHolder |
col(String name,
T... data)
Returns a ColumnHolder that can be used when creating in-memory tables.
|
static ColumnSource<Byte> |
colSource(byte... values)
Creates an in-memory column of type byte for a collection of values.
|
static ColumnSource<Character> |
colSource(char... values)
Creates an in-memory column of type char for a collection of values.
|
static <T> ColumnSource<T> |
colSource(Class<T> clazz,
Collection<T> values)
Creates an in-memory column of the specified type for a collection of values.
|
static ColumnSource<Double> |
colSource(double... values)
Creates an in-memory column of type double for a collection of values.
|
static ColumnSource<Float> |
colSource(float... values)
Creates an in-memory column of type float for a collection of values.
|
static ColumnSource<Integer> |
colSource(int... values)
Creates an in-memory column of type int for a collection of values.
|
static ColumnSource<Long> |
colSource(long... values)
Creates an in-memory column of type long for a collection of values.
|
static ColumnSource<Short> |
colSource(short... values)
Creates an in-memory column of type short for a collection of values.
|
static String |
diff(Table actualResult,
Table expectedResult,
long maxDiffLines)
Computes the difference of two tables for use in verification.
|
static String |
diff(Table actualResult,
Table expectedResult,
long maxDiffLines,
EnumSet<TableDiff.DiffItems> itemsToSkip)
Computes the difference of two tables for use in verification.
|
static JFrame |
display(Table source,
boolean shutdownProcessOnClose,
Map<String,Format> formatters,
String... columns)
Deprecated.
|
static JFrame |
display(Table source,
boolean shutdownProcessOnClose,
String... columns)
Deprecated.
|
static JFrame |
display(Table source,
Map<String,Format> formatters,
String... columns)
Deprecated.
|
static JFrame |
display(Table source,
String... columns)
Deprecated.
|
static ColumnHolder |
doubleCol(String name,
double... data)
Returns a ColumnHolder of type double that can be used when creating in-memory tables.
|
static Table |
emptyTable(long size)
Returns a new empty Iris Table with no columns, but with defined number of rows.
|
static Table |
emptyTable(long size,
TableDefinition tableDefinition)
Returns a new empty Iris Table with columns based on the specified TableDefinition.
|
static ColumnHolder |
floatCol(String name,
float... data)
Returns a ColumnHolder of type float that can be used when creating in-memory tables.
|
static Object |
getKey(ColumnSource[] groupByColumnSources,
long row)
Returns a SmartKey for the specified row from a set of ColumnSources.
|
static Object |
getPrevKey(ColumnSource[] groupByColumnSources,
long row)
Returns a SmartKey for the row previous to the specified row from a set of ColumnSources.
|
static String |
html(Table source)
Returns a printout of a table formatted as HTML.
|
static ColumnHolder |
intCol(String name,
int... data)
Returns a ColumnHolder of type int that can be used when creating in-memory tables.
|
static ColumnHolder |
longCol(String name,
long... data)
Returns a ColumnHolder of type long that can be used when creating in-memory tables.
|
static Table |
merge(Collection<Table> tables)
Concatenates multiple Iris Tables into a single Table.
|
static Table |
merge(List<Table> theList)
Concatenates multiple Iris Tables into a single Table.
|
static Table |
merge(Table... tables)
Concatenates multiple Iris Tables into a single Table.
|
static Table |
mergeSorted(String keyColumn,
Collection<Table> tables)
Concatenates multiple sorted Iris Tables into a single Table sorted by the specified key column.
|
static Table |
mergeSorted(String keyColumn,
Table... tables)
Concatenates multiple sorted Iris Tables into a single Table sorted by the specified key column.
|
static DynamicTable |
newTable(ColumnHolder... columnHolders)
Creates a new DynamicTable from one or more ColumnHolders.
|
static DynamicTable |
newTable(long size,
List<String> names,
List<ColumnSource> columnSources)
Creates a new DynamicTable from one or more ColumnSources.
|
static DynamicTable |
newTable(long size,
Map<String,ColumnSource> columns)
Creates a new DynamicTable from a Map of one or more ColumnSources.
|
static DynamicTable |
newTable(TableDefinition definition)
Creates a new empty DynamicTable from a TableDefinition.
|
static <T> ColumnSource |
objColSource(T... values)
Creates an in-memory column of the specified type for a collection of values
|
static Table |
readBin(String namespace,
String tableName,
File... sourceFiles)
Loads a binary log file as an in-memory DB table.
|
static Table |
readBin(String namespace,
String tableName,
File sourceDirectory,
String sourceFileNameGlob)
Loads a binary log file as an in-memory DB table.
|
static Table |
readBin(String namespace,
String tableName,
String... sourceFiles)
Loads a binary log file as an in-memory DB table.
|
static Table |
readBin(String namespace,
String tableName,
TableDefinition tableDefinition,
File... sourceFiles)
Loads a binary log file as an in-memory DB table.
|
static Table |
readBin(String namespace,
String tableName,
TableType tableType,
File... sourceFiles)
Loads a binary log file as an in-memory DB table.
|
static Table |
readBin(TableKey key,
File... sourceFiles) |
static Table |
readCsv(File file)
Returns a memory table created from importing CSV data.
|
static Table |
readCsv(File file,
StatusCallback progress)
Returns a memory table created from importing CSV data.
|
static Table |
readCsv(File file,
String format,
StatusCallback progress)
Returns a memory table created from importing CSV data.
|
static DynamicTable |
readCsv(InputStream is)
Returns a memory table created from importing CSV data.
|
static Table |
readCsv(String filePath)
Returns a memory table created from importing CSV data.
|
static Table |
readCsv(String filePath,
String format)
Returns a memory table created from importing CSV data.
|
static Table |
readCsv(String filePath,
String format,
StatusCallback progress)
Returns a memory table created from importing CSV data.
|
static Table |
readHeaderlessCsv(File file,
String format,
StatusCallback progress,
Collection<String> header)
Returns a memory table created from importing CSV data.
|
static Table |
readHeaderlessCsv(String filePath)
Returns a memory table created from importing CSV data.
|
static Table |
readHeaderlessCsv(String filePath,
Collection<String> header)
Returns a memory table created from importing CSV data.
|
static Table |
readHeaderlessCsv(String filePath,
String... header)
Returns a memory table created from importing CSV data.
|
static Table |
readHeaderlessCsv(String filePath,
String format,
StatusCallback progress,
Collection<String> header)
Returns a memory table created from importing CSV data.
|
static Table |
roundDecimalColumns(Table table)
Produce a new table with all the columns of this table, in the same order, but with all
double and
float columns rounded to long s. |
static Table |
roundDecimalColumns(Table table,
String... columns)
Produce a new table with all the columns of this table, in the same order, but with the specified columns rounded
to
long s. |
static Table |
roundDecimalColumnsExcept(Table table,
String... columnsNotToRound)
Produce a new table with all the columns of this table, in the same order, but with all
double and
float columns rounded to long s, except for the specified columnsNotToRound . |
static ColumnHolder |
shortCol(String name,
short... data)
Returns a ColumnHolder of type short that can be used when creating in-memory tables.
|
static void |
show(Table source,
DBTimeZone timeZone,
String... columns)
Prints the first few rows of a table to standard output, adjusted to the specified time zone.
|
static void |
show(Table source,
long maxRowCount,
DBTimeZone timeZone,
PrintStream out,
String... columns)
Prints the first specified number of rows of a table to a specfied output, adjusted relative to the specified time zone.
|
static void |
show(Table source,
long maxRowCount,
DBTimeZone timeZone,
String... columns)
Prints the first specified number of rows of a table to standard output, adjusted relative to the specified time zone.
|
static void |
show(Table source,
long maxRowCount,
DBTimeZone timeZone,
String delimiter,
PrintStream out,
boolean showIndex,
String... columns)
Prints the first specified number of rows of a table to a specfied output, adjusted relative to the specified time zone,
with a specified delimiter between values, and optionally with details of the index and record positions that provided the values.
|
static void |
show(Table source,
long maxRowCount,
String... columns)
Prints the first specified number of rows of a table to standard output.
|
static void |
show(Table source,
String... columns)
Prints the first few rows of a table to standard output.
|
static void |
showCommaDelimited(Table source,
long maxRowCount,
String... columns)
Prints the first specified number of rows of a table to standard output, with commas between the values.
|
static void |
showCommaDelimited(Table source,
String... columns)
Prints the first few rows of a table to standard output, with commas between values.
|
static void |
showWithIndex(Table source,
long maxRowCount,
DBTimeZone timeZone,
PrintStream out,
String... columns)
Prints the first specified number of rows of a table to a specfied output, adjusted relative to the specified time zone,
and also prints the details of the index and record positions that provided the values.
|
static void |
showWithIndex(Table source,
long maxRowCount,
String... columns)
Prints the first specified number of rows of a table to standard output, and also prints the details of the index and record positions that provided the values.
|
static void |
showWithIndex(Table source,
String... columns)
Prints the first few rows of a table to standard output, and also prints the details of the index and record positions that provided the values.
|
static String |
string(Table t,
DBTimeZone timeZone,
String... columns)
Returns the first few rows of a table as a pipe-delimited string, adjusted relative to the specified time zone.
|
static String |
string(Table t,
int size,
DBTimeZone timeZone,
String... columns)
Returns the first specified number of rows of a table as a pipe-delimited string, adjusted relative to the specified time zone.
|
static String |
string(Table t,
int size,
String... columns)
Returns the first specified number of rows of a table as a pipe-delimited string.
|
static String |
string(Table t,
String... columns)
Returns the first few rows of a table as a pipe-delimited string.
|
static void |
writeCsv(String sourcePath,
String destPath,
DBTimeZone timeZone,
String... columns)
Writes a DB table out as a CSV file.
|
static void |
writeCsv(String sourcePath,
String destPath,
String... columns)
Writes a DB table out as a CSV file.
|
static void |
writeCsv(Table[] sources,
String destPath,
boolean compressed,
DBTimeZone timeZone,
String separator,
String... columns)
Writes a set of DB tables out as a CSV file.
|
static void |
writeCsv(Table source,
boolean compressed,
String destPath,
String... columns)
Writes a DB table out as a CSV file.
|
static void |
writeCsv(Table source,
String destPath,
boolean compressed,
DBTimeZone timeZone,
String... columns)
Writes a DB table out as a CSV file.
|
static void |
writeCsv(Table source,
String destPath,
String... columns)
Writes a DB table out as a CSV file.
|
public static final String NULL_STRING
public static void show(Table source, String... columns)
source
- an Deephaven table objectcolumns
- varargs of column names to displaypublic static void showWithIndex(Table source, String... columns)
source
- an Deephaven table objectcolumns
- varargs of column names to displaypublic static void showCommaDelimited(Table source, String... columns)
source
- an Deephaven table objectcolumns
- varargs of column names to displaypublic static void show(Table source, DBTimeZone timeZone, String... columns)
source
- an Deephaven table objecttimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjustedcolumns
- varargs of column names to displaypublic static void show(Table source, long maxRowCount, String... columns)
source
- an Deephaven table objectmaxRowCount
- the number of rows to returncolumns
- varargs of column names to displaypublic static void showWithIndex(Table source, long maxRowCount, String... columns)
source
- an Deephaven table objectmaxRowCount
- the number of rows to returncolumns
- varargs of column names to displaypublic static void showCommaDelimited(Table source, long maxRowCount, String... columns)
source
- an Iris table objectmaxRowCount
- the number of rows to returncolumns
- varargs of column names to displaypublic static void show(Table source, long maxRowCount, DBTimeZone timeZone, String... columns)
source
- an Iris table objectmaxRowCount
- the number of rows to returntimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjustedcolumns
- varargs of column names to displaypublic static void show(Table source, long maxRowCount, DBTimeZone timeZone, PrintStream out, String... columns)
source
- an Iris table objectmaxRowCount
- the number of rows to returntimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjustedout
- a PrintStream destination to which to print the datacolumns
- varargs of column names to displaypublic static void showWithIndex(Table source, long maxRowCount, DBTimeZone timeZone, PrintStream out, String... columns)
source
- an Iris table objectmaxRowCount
- the number of rows to returntimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjustedout
- a PrintStream destination to which to print the datacolumns
- varargs of column names to displaypublic static void show(Table source, long maxRowCount, DBTimeZone timeZone, String delimiter, PrintStream out, boolean showIndex, String... columns)
source
- an Iris table objectmaxRowCount
- the number of rows to returntimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjusteddelimiter
- a String value to use between printed valuesout
- a PrintStream destination to which to print the datashowIndex
- a boolean indicating whether to also print index detailscolumns
- varargs of column names to display@Deprecated public static JFrame display(Table source, String... columns)
@Deprecated public static JFrame display(Table source, boolean shutdownProcessOnClose, String... columns)
@Deprecated public static JFrame display(Table source, Map<String,Format> formatters, String... columns)
@Deprecated public static JFrame display(Table source, boolean shutdownProcessOnClose, Map<String,Format> formatters, String... columns)
public static String string(Table t, String... columns) throws IOException
t
- an Iris table objectcolumns
- varargs of columns to include in the resultIOException
- if the table files can't be readpublic static String string(Table t, int size, String... columns) throws IOException
t
- an Iris table objectsize
- the number of rows to returncolumns
- varargs of columns to include in the resultIOException
- if the table files can't be readpublic static String string(Table t, DBTimeZone timeZone, String... columns) throws IOException
t
- an Iris table objecttimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjustedcolumns
- varargs of columns to include in the resultIOException
- if the table files can't be readpublic static String string(Table t, int size, DBTimeZone timeZone, String... columns) throws IOException
t
- an Iris table objectsize
- the number of rows to returntimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjustedcolumns
- varargs of columns to include in the resultIOException
- if the table files can't be readpublic static String html(Table source)
source
- an Iris table objectpublic static String diff(Table actualResult, Table expectedResult, long maxDiffLines)
actualResult
- first Iris table object to compareexpectedResult
- second Iris table object to comparemaxDiffLines
- stop comparing after this many differences are foundpublic static String diff(Table actualResult, Table expectedResult, long maxDiffLines, EnumSet<TableDiff.DiffItems> itemsToSkip)
actualResult
- first Iris table object to compareexpectedResult
- second Iris table object to comparemaxDiffLines
- stop comparing after this many differences are founditemsToSkip
- EnumSet of checks not to perform, such as checking column order, or exact match of double valuespublic static Table readBin(@NotNull String namespace, @NotNull String tableName, @NotNull File sourceDirectory, @NotNull String sourceFileNameGlob)
namespace
- namespace to search for the Listener needed to import the datatableName
- table name to find for the Listener needed to import the datasourceDirectory
- file system path of the log filesourceFileNameGlob
- file pattern to use to find log file(s) to importpublic static Table readBin(@NotNull String namespace, @NotNull String tableName, String... sourceFiles)
namespace
- namespace to search for the Listener needed to import the datatableName
- table name to find for the Listener needed to import the datasourceFiles
- list of names of files to importpublic static Table readBin(@NotNull String namespace, @NotNull String tableName, File... sourceFiles)
namespace
- namespace to search for the Listener needed to import the datatableName
- table name to find for the Listener needed to import the datasourceFiles
- list of File objects to importpublic static Table readBin(@NotNull String namespace, @NotNull String tableName, @NotNull TableType tableType, File... sourceFiles)
namespace
- namespace to search for the Listener needed to import the datatableName
- table name to find for the Listener needed to import the datatableType
- table type this table definitionsourceFiles
- list of File objects to importpublic static Table readBin(@NotNull String namespace, @NotNull String tableName, TableDefinition tableDefinition, File... sourceFiles)
namespace
- namespace to search for the Listener needed to import the datatableName
- table name to find for the Listener needed to import the datatableDefinition
- use this table definition rather than looking one upsourceFiles
- list of File objects to importpublic static DynamicTable readCsv(InputStream is) throws IOException
is
- an InputStream providing access to the CSV data.IOException
- if the InputStream cannot be readpublic static Table readCsv(String filePath) throws IOException
filePath
- the fully-qualified path to a CSV file to be readIOException
- if the file cannot be readpublic static Table readCsv(String filePath, String format) throws IOException
filePath
- the fully-qualified path to a CSV file to be readformat
- an Apache Commons CSV format name to be used to parse the CSVIOException
- if the file cannot be readpublic static Table readCsv(String filePath, String format, StatusCallback progress) throws IOException
filePath
- the fully-qualified path to a CSV file to be readformat
- an Apache Commons CSV format name to be used to parse the CSVprogress
- a StatusCallback object that can be used to log progress details or update a progress bar. If passed explicitly as null, a StatusCallback instance will be created to log progress to the current logger.IOException
- if the file cannot be readpublic static Table readCsv(File file) throws IOException
file
- a file object providing access to the CSV file to be readIOException
- if the file cannot be readpublic static Table readCsv(File file, StatusCallback progress) throws IOException
file
- a file object providing access to the CSV file to be readprogress
- a StatusCallback object that can be used to log progress details or update a progress bar.
If passed explicitly as null, a StatusCallback instance will be created to log progress to the current logger.IOException
- if the file cannot be readpublic static Table readCsv(File file, String format, StatusCallback progress) throws IOException
file
- a file object providing access to the CSV file to be readformat
- an Apache Commons CSV format name to be used to parse the CSVprogress
- a StatusCallback object that can be used to log progress details or update a progress bar.
If passed explicitly as null, a StatusCallback instance will be created to log progress to the current logger.IOException
- if the file cannot be readpublic static Table readHeaderlessCsv(String filePath) throws IOException
filePath
- the fully-qualified path to a CSV file to be readIOException
- if the file cannot be readpublic static Table readHeaderlessCsv(String filePath, Collection<String> header) throws IOException
filePath
- the fully-qualified path to a CSV file to be readheader
- Column names to use for the resultant table.IOException
- if the file cannot be readpublic static Table readHeaderlessCsv(String filePath, String... header) throws IOException
filePath
- the fully-qualified path to a CSV file to be readheader
- Column names to use for the resultant table.IOException
- if the file cannot be readpublic static Table readHeaderlessCsv(String filePath, String format, StatusCallback progress, Collection<String> header) throws IOException
filePath
- the fully-qualified path to a CSV file to be readformat
- an Apache Commons CSV format name to be used to parse the CSVprogress
- a StatusCallback object that can be used to log progress details or update a progress bar. If passed explicitly as null, a StatusCallback instance will be created to log progress to the current logger.header
- Column names to use for the resultant table.IOException
- if the file cannot be readpublic static Table readHeaderlessCsv(File file, String format, StatusCallback progress, @Nullable Collection<String> header) throws IOException
file
- a file object providing access to the CSV file to be readformat
- an Apache Commons CSV format name to be used to parse the CSVprogress
- a StatusCallback object that can be used to log progress details or update a progress bar.
If passed explicitly as null, a StatusCallback instance will be created to log progress to the current logger.header
- Column names to use for the resultant table, or null if column names should be automatically generated.IOException
- if the file cannot be readpublic static void writeCsv(String sourcePath, String destPath, String... columns) throws IOException
sourcePath
- path to the table files to be exporteddestPath
- path to the CSV file to be writtencolumns
- a list of columns to include in the exportIOException
- if source files cannot be read or target file cannot be writtenpublic static void writeCsv(String sourcePath, String destPath, DBTimeZone timeZone, String... columns) throws IOException
sourcePath
- path to the table files to be exporteddestPath
- path to the CSV file to be writtentimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjustedcolumns
- a list of columns to include in the exportIOException
- if source files cannot be read or target file cannot be writtenpublic static void writeCsv(Table source, boolean compressed, String destPath, String... columns) throws IOException
source
- an Iris table object to be exporteddestPath
- path to the CSV file to be writtencompressed
- whether to compress (bz2) the file being writtencolumns
- a list of columns to include in the exportIOException
- if the target file cannot be writtenpublic static void writeCsv(Table source, String destPath, String... columns) throws IOException
source
- an Iris table object to be exporteddestPath
- path to the CSV file to be writtencolumns
- a list of columns to include in the exportIOException
- if the target file cannot be writtenpublic static void writeCsv(Table source, String destPath, boolean compressed, DBTimeZone timeZone, String... columns) throws IOException
source
- an Iris table object to be exporteddestPath
- path to the CSV file to be writtencompressed
- whether to zip the file being writtentimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjustedcolumns
- a list of columns to include in the exportIOException
- if the target file cannot be writtenpublic static void writeCsv(Table[] sources, String destPath, boolean compressed, DBTimeZone timeZone, String separator, String... columns) throws IOException
sources
- an array of Iris table objects to be exporteddestPath
- path to the CSV file to be writtencompressed
- whether to compress (bz2) the file being writtentimeZone
- a DBTimeZone constant relative to which DBDateTime data should be adjustedseparator
- a String (normally a single character) to be used as the field delimitercolumns
- a list of columns to include in the exportIOException
- if the target file cannot be writtenpublic static <T> ColumnSource<T> colSource(Class<T> clazz, Collection<T> values)
T
- the type to use for the new columnclazz
- the class to use for the new columnvalues
- a collection of values to populate the new columnpublic static <T> ColumnSource objColSource(T... values)
T
- the type to use for the new columnvalues
- a collection of values to populate the new columnpublic static ColumnSource<Long> colSource(long... values)
values
- a collection of values to populate the new columnpublic static ColumnSource<Integer> colSource(int... values)
values
- a collection of values to populate the new columnpublic static ColumnSource<Short> colSource(short... values)
values
- a collection of values to populate the new columnpublic static ColumnSource<Byte> colSource(byte... values)
values
- a collection of values to populate the new columnpublic static ColumnSource<Character> colSource(char... values)
values
- a collection of values to populate the new columnpublic static ColumnSource<Double> colSource(double... values)
values
- a collection of values to populate the new columnpublic static ColumnSource<Float> colSource(float... values)
values
- a collection of values to populate the new columnpublic static Object getKey(ColumnSource[] groupByColumnSources, long row)
groupByColumnSources
- a set of ColumnSources from which to retrieve the datarow
- the row number for which to retrieve datapublic static Object getPrevKey(ColumnSource[] groupByColumnSources, long row)
groupByColumnSources
- a set of ColumnSources from which to retrieve the datarow
- the row number for which to retrieve the previous row's datapublic static <T> ColumnHolder col(String name, T... data)
T
- the type of the columnname
- name of the columndata
- a list of values for the columnpublic static ColumnHolder longCol(String name, long... data)
name
- name of the columndata
- a list of values for the columnpublic static ColumnHolder intCol(String name, int... data)
name
- name of the columndata
- a list of values for the columnpublic static ColumnHolder shortCol(String name, short... data)
name
- name of the columndata
- a list of values for the columnpublic static ColumnHolder byteCol(String name, byte... data)
name
- name of the columndata
- a list of values for the columnpublic static ColumnHolder charCol(String name, char... data)
name
- name of the columndata
- a list of values for the columnpublic static ColumnHolder doubleCol(String name, double... data)
name
- name of the columndata
- a list of values for the columnpublic static ColumnHolder floatCol(String name, float... data)
name
- name of the columndata
- a list of values for the columnpublic static Table emptyTable(long size)
size
- the number of rows to allocate space forpublic static Table emptyTable(long size, TableDefinition tableDefinition)
size
- the number of rows to allocate space fortableDefinition
- the TableDefinition (column names and properties) to use for the new tablepublic static DynamicTable newTable(long size, List<String> names, List<ColumnSource> columnSources)
size
- the number of rows to allocatenames
- a List of column namescolumnSources
- a List of the ColumnSource(s)public static DynamicTable newTable(long size, Map<String,ColumnSource> columns)
size
- the number of rows to allocatecolumns
- a Map of column names and ColumnSourcespublic static DynamicTable newTable(TableDefinition definition)
definition
- the TableDefinition (column names and properties) to use for the new tablepublic static DynamicTable newTable(ColumnHolder... columnHolders)
columnHolders
- a list of ColumnHolders from which to create the tablepublic static Table merge(List<Table> theList)
For historical tables, the resultant table will have rows from the same table together; in the order they are specified as inputs.
For ticking tables, the original result will be similarly ordered; however as tables grow the new rows for each table may be appended to the end of the result and intermixed. To ensure input order; you must annotate each table with a column indicating the source and then sort the result based on that column.
theList
- a List of Tables to be concatenatedpublic static Table merge(Collection<Table> tables)
For historical tables, the resultant table will have rows from the same table together; in the order they are specified as inputs.
For ticking tables, the original result will be similarly ordered; however as tables grow the new rows for each table may be appended to the end of the result and intermixed. To ensure input order; you must annotate each table with a column indicating the source and then sort the result based on that column.
tables
- a Collection of Tables to be concatenatedpublic static Table merge(Table... tables)
For historical tables, the resultant table will have rows from the same table together; in the order they are specified as inputs.
For ticking tables, the original result will be similarly ordered; however as tables grow the new rows for each table may be appended to the end of the result and intermixed. To ensure input order; you must annotate each table with a column indicating the source and then sort the result based on that column.
tables
- a list of Tables to be concatenatedpublic static Table mergeSorted(String keyColumn, Table... tables)
tables
- sorted Tables to be concatenatedkeyColumn
- the column to use when sorting the concatenated resultspublic static Table mergeSorted(String keyColumn, Collection<Table> tables)
tables
- a Collection of sorted Tables to be concatenatedkeyColumn
- the column to use when sorting the concatenated resultspublic static Table roundDecimalColumns(Table table)
double
and
float
columns rounded to long
s.Table
, with columns modified as explained abovepublic static Table roundDecimalColumnsExcept(Table table, String... columnsNotToRound)
double
and
float
columns rounded to long
s, except for the specified columnsNotToRound
.columnsNotToRound
- The names of the double
and float
columns not to round to long
sTable
, with columns modified as explained abovepublic static Table roundDecimalColumns(Table table, String... columns)
long
s. The given columns must be double
or float
columns.columns
- The names of the double
and float
columns to roundTable
, with columns modified as explained aboveIllegalArgumentException
- If columns
is null, or if one of the specified columns
is neither a double
column nor a float
column.