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 int hashCode()
55 {
56 final int prime = 31;
57 int result = 1;
58 result = prime * result + ((this.nodeName == null) ? 0 : this.nodeName.hashCode());
59 return result;
60 }
61
62
63 @Override
64 public boolean equals(Object obj)
65 {
66 if (this == obj)
67 return true;
68 if (obj == null)
69 return false;
70 if (getClass() != obj.getClass())
71 return false;
72 NodeData other = (NodeData) obj;
73 if (this.nodeName == null)
74 {
75 if (other.nodeName != null)
76 return false;
77 }
78 else if (!this.nodeName.equals(other.nodeName))
79 return false;
80 return true;
81 }
82
83
84 @Override
85 public String toString()
86 {
87 return "NodeData [nodeName=" + this.nodeName + ", position=" + this.position + "]";
88 }
89
90 }