1 package org.opentrafficsim.kpi.sampling;
2
3 import java.util.Collection;
4
5 import org.djunits.Throw;
6 import org.djutils.immutablecollections.ImmutableArrayList;
7 import org.djutils.immutablecollections.ImmutableList;
8
9
10
11
12
13
14
15
16
17
18
19 public abstract class AbstractTable implements Table
20 {
21
22
23 private final String id;
24
25
26 private final String description;
27
28
29 private final ImmutableList<Column<?>> columns;
30
31
32
33
34
35
36
37 public AbstractTable(final String id, final String description, final Collection<Column<?>> columns)
38 {
39 Throw.whenNull(id, "Id may not be null.");
40 Throw.whenNull(description, "Description may not be null.");
41 this.id = id;
42 this.description = description;
43 this.columns = new ImmutableArrayList<>(columns);
44 }
45
46
47 @Override
48 public ImmutableList<Column<?>> getColumns()
49 {
50 return this.columns;
51 }
52
53
54 @Override
55 public String getId()
56 {
57 return this.id;
58 }
59
60
61 @Override
62 public String getDescription()
63 {
64 return this.description;
65 }
66
67 }