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