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