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