Package org.djutils.data
Class ListTable
java.lang.Object
org.djutils.data.Table
org.djutils.data.ListTable
- All Implemented Interfaces:
Iterable<Row>,Identifiable
Table implementation that stores
Records in a List.
Copyright (c) 2020-2025 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
ConstructorsConstructorDescriptionListTable(String id, String description, Collection<Column<?>> columns) Constructor. -
Method Summary
Methods inherited from class org.djutils.data.Table
getColumn, getColumnDataTypes, getColumnDataTypeStrings, getColumnDescriptions, getColumnIds, getColumnNumber, getColumnNumber, getColumns, getDescription, getId, getNumberOfColumns, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ListTable
Constructor.- Parameters:
id- iddescription- descriptioncolumns- columns
-
-
Method Details
-
iterator
-
isEmpty
public boolean isEmpty()Description copied from class:TableReturns whether the table is empty. -
addRow
Adds a row to the table.- Parameters:
data- data with values given per column- Throws:
IllegalArgumentException- when the size or data types in the data map do not comply to the columns
-
addRowByColumnIds
Adds a row to the table.- Parameters:
data- data with values given per column id- Throws:
IllegalArgumentException- when the size or data types in the data map do not comply to the columns
-
addRow
Adds a row to the table. The order in which the elements in the array are offered should be the same as the order of the columns.- Parameters:
data- row data- Throws:
IllegalArgumentException- when the size, order or data types in theObject[]do not comply to the columns
-