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
17 public class NodeData implements NodeDataInterface
18 {
19
20
21 private final Node node;
22
23
24
25
26 public NodeData(final Node node)
27 {
28 this.node = node;
29 }
30
31
32
33
34 public final Node getNode()
35 {
36 return this.node;
37 }
38
39
40 @Override
41 public final String getId()
42 {
43 return this.node.getId();
44 }
45
46
47 @Override
48 public final int hashCode()
49 {
50 final int prime = 31;
51 int result = 1;
52 result = prime * result + ((this.node == null) ? 0 : this.node.hashCode());
53 return result;
54 }
55
56
57 @Override
58 public final boolean equals(final Object obj)
59 {
60 if (this == obj)
61 {
62 return true;
63 }
64 if (obj == null)
65 {
66 return false;
67 }
68 if (getClass() != obj.getClass())
69 {
70 return false;
71 }
72 NodeData other = (NodeData) obj;
73 if (this.node == null)
74 {
75 if (other.node != null)
76 {
77 return false;
78 }
79 }
80 else if (!this.node.equals(other.node))
81 {
82 return false;
83 }
84 return true;
85 }
86
87
88 @Override
89 public final String toString()
90 {
91 return "NodeData [node=" + this.node + "]";
92 }
93
94 }