1 package org.opentrafficsim.kpi.sampling.meta;
2
3 import org.opentrafficsim.kpi.interfaces.GtuDataInterface;
4 import org.opentrafficsim.kpi.interfaces.NodeDataInterface;
5
6 import nl.tudelft.simulation.language.Throw;
7
8
9
10
11
12
13
14
15
16
17
18
19 public class MetaDataOrigin extends MetaDataType<NodeDataInterface>
20 {
21
22
23
24
25 public MetaDataOrigin()
26 {
27 super("origin");
28 }
29
30
31 @Override
32 public final NodeDataInterface getValue(final GtuDataInterface gtu)
33 {
34 Throw.whenNull(gtu, "GTU may not be null.");
35 return gtu.getOriginNodeData();
36 }
37
38
39 @Override
40 public String formatValue(String format, NodeDataInterface value)
41 {
42 return value.getId();
43 }
44
45
46 @Override
47 @SuppressWarnings("checkstyle:designforextension")
48 public String toString()
49 {
50 return "MetaDataOrigin: [id=" + getId() + "]";
51 }
52
53 }