Package org.djutils.data
Class ListTable
java.lang.Object
org.djutils.data.Table
org.djutils.data.ListTable
Table implementation that stores
Record
s in a List
.
Copyright (c) 2020-2024 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
ConstructorDescriptionListTable
(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, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ListTable
Constructor.- Parameters:
id
- String; iddescription
- String; descriptioncolumns
- Collection<Column<?>>; columns
-
-
Method Details
-
iterator
-
isEmpty
public boolean isEmpty()Description copied from class:Table
Returns whether the table is empty. -
addRow
Adds a row to the table.- Parameters:
data
- Map<String, Object>; 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
- Map<String, Object>; 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
- Object[]; row data- Throws:
IllegalArgumentException
- when the size, order or data types in theObject[]
do not comply to the columns
-