View Javadoc
1   package org.opentrafficsim.kpi.sampling;
2   
3   import org.djutils.immutablecollections.ImmutableList;
4   import org.opentrafficsim.base.Identifiable;
5   
6   /**
7    * Table with data stored in structured records.
8    * <p>
9    * Copyright (c) 2020-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10   * BSD-style license. See <a href="https://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
11   * </p>
12   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
13   * @author <a href="https://www.tudelft.nl/pknoppers">Peter Knoppers</a>
14   * @author <a href="https://www.transport.citg.tudelft.nl">Wouter Schakel</a>
15   */
16  public interface Table extends Iterable<Record>, Identifiable
17  {
18      
19      /**
20       * Returns the description.
21       * @return description
22       */
23      String getDescription();
24  
25      /**
26       * Returns the list of columns.
27       * @return list of columns
28       */
29      ImmutableList<Column<?>> getColumns();
30  
31      /**
32       * Returns the number of columns.
33       * @return number of columns
34       */
35      default int getNumberOfColumns()
36      {
37          return getColumns().size();
38      }
39  
40      /**
41       * Returns whether the table is empty.
42       * @return whether the table is empty
43       */
44      boolean isEmpty();
45  
46  }