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
17 public class RouteData implements RouteDataInterface
18 {
19
20
21 private final Route route;
22
23
24
25
26 public RouteData(final Route route)
27 {
28 this.route = route;
29 }
30
31
32
33
34 public final Route getRoute()
35 {
36 return this.route;
37 }
38
39
40 @Override
41 public final String getId()
42 {
43 return this.route.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.route == null) ? 0 : this.route.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 RouteData other = (RouteData) obj;
73 if (this.route == null)
74 {
75 if (other.route != null)
76 {
77 return false;
78 }
79 }
80 else if (!this.route.equals(other.route))
81 {
82 return false;
83 }
84 return true;
85 }
86
87
88 @Override
89 public final String toString()
90 {
91 return "RouteData [route=" + this.route + "]";
92 }
93
94 }