1 package org.opentrafficsim.sim0mq.kpi;
2
3 import org.opentrafficsim.kpi.interfaces.NodeDataInterface;
4
5 import nl.tudelft.simulation.language.d3.CartesianPoint;
6
7
8
9
10
11
12
13
14
15
16
17 public class NodeData implements NodeDataInterface
18 {
19
20
21 private final String nodeName;
22
23
24 private final CartesianPoint position;
25
26
27
28
29
30 public NodeData(final String nodeName, final CartesianPoint position)
31 {
32 this.nodeName = nodeName;
33 this.position = position;
34 }
35
36
37
38
39 public final String getNodeName()
40 {
41 return this.nodeName;
42 }
43
44
45
46
47 public final CartesianPoint getPosition()
48 {
49 return this.position;
50 }
51
52
53 @Override
54 public String getId()
55 {
56 return this.nodeName;
57 }
58
59
60 @Override
61 public int hashCode()
62 {
63 final int prime = 31;
64 int result = 1;
65 result = prime * result + ((this.nodeName == null) ? 0 : this.nodeName.hashCode());
66 return result;
67 }
68
69
70 @Override
71 public boolean equals(Object obj)
72 {
73 if (this == obj)
74 return true;
75 if (obj == null)
76 return false;
77 if (getClass() != obj.getClass())
78 return false;
79 NodeData other = (NodeData) obj;
80 if (this.nodeName == null)
81 {
82 if (other.nodeName != null)
83 return false;
84 }
85 else if (!this.nodeName.equals(other.nodeName))
86 return false;
87 return true;
88 }
89
90
91 @Override
92 public String toString()
93 {
94 return "NodeData [nodeName=" + this.nodeName + ", position=" + this.position + "]";
95 }
96
97 }