public final class Tables extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Table<Column<T>,T> |
wrap(List<? extends Map<?,T>> data,
List<String> rowHeaders)
Creates a table wrapping a list of maps.
|
static <T> Table<Column<T>,T> |
wrap(List<T> data,
String colHeader,
List<String> rowHeaders)
Creates a single-column table wrapping a list.
|
static <T> Table<Column<T>,T> |
wrap(Map<?,T> data,
String colHeader)
Creates a single-column table wrapping a map.
|
public static <T> Table<Column<T>,T> wrap(Map<?,T> data, String colHeader)
T
- The type of data in each cell of the table.data
- The data to wrap. Each map entry is a row.colHeader
- Header to use for the table's sole column. Pass null for
no column header.Table
object wrapping the data structure.public static <T> Table<Column<T>,T> wrap(List<T> data, String colHeader, List<String> rowHeaders)
T
- The type of data in each cell of the table.data
- The data to wrap. Each list element is a row.colHeader
- Header to use for the table's sole column. Pass null for
no column header.rowHeaders
- List of row header labels. Pass null for no row headers.Table
object wrapping the data structure.public static <T> Table<Column<T>,T> wrap(List<? extends Map<?,T>> data, List<String> rowHeaders)
Note that columns are inferred from the first map/row of the table, not unioned across all rows.
T
- The type of data in each cell of the table.data
- The data to wrap. Each list element is a row; maps go from
column name to data.rowHeaders
- List of row header labels. Pass null for no row headers.Table
object wrapping the data structure.Copyright © 2015–2022 SciJava. All rights reserved.