Package com.illumon.iris.db.v2.utils
Class TableBuilder
java.lang.Object
com.illumon.iris.db.v2.utils.TableBuilder
public class TableBuilder extends Object
Class to aid in building Tables from a TableDefinition.
-
Constructor Summary
Constructors Constructor Description TableBuilder(TableDefinition def)
Creates a TableBuilder object based on a table Definition.TableBuilder(TableDefinition def, int initialCapacity)
-
Method Summary
-
Constructor Details
-
TableBuilder
Creates a TableBuilder object based on a table Definition.- Parameters:
def
- the definition of the table that you want to build
-
TableBuilder
-
-
Method Details
-
rowCount
public long rowCount()returns the number of rows the table has- Returns:
- the size of the row List
-
addRow
Adds a row to the table. Items will be inserted into the row the order they are put into this method- Parameters:
items
- The items that will appear in the row. Must be the same amount of items as columns
-
build
Builds the table from the TableDefinition and the rows added. Calling this will reset the state of this builder as inclear()
.- Returns:
- A new table containing the rows added via
addRow(Object...)
-
clear
public void clear()Deletes all rows from the TableBuilder.
-