1 package org.opentrafficsim.sim0mq.kpi;
2
3 import org.opentrafficsim.kpi.interfaces.RouteDataInterface;
4
5
6
7
8
9
10
11
12
13
14
15 public class RouteData implements RouteDataInterface
16 {
17
18 private final String routeName;
19
20
21 private final NodeData startNode;
22
23
24 private final NodeData endNode;
25
26
27
28
29
30
31 public RouteData(final String routeName, final NodeDataData.html#NodeData">NodeData startNode, final NodeData endNode)
32 {
33 this.routeName = routeName;
34 this.startNode = startNode;
35 this.endNode = endNode;
36 }
37
38
39
40
41 public final String getRouteName()
42 {
43 return this.routeName;
44 }
45
46
47
48
49 public final NodeData getStartNode()
50 {
51 return this.startNode;
52 }
53
54
55
56
57 public final NodeData getEndNode()
58 {
59 return this.endNode;
60 }
61
62
63 @Override
64 public String getId()
65 {
66 return this.routeName;
67 }
68
69
70 @Override
71 public int hashCode()
72 {
73 final int prime = 31;
74 int result = 1;
75 result = prime * result + ((this.routeName == null) ? 0 : this.routeName.hashCode());
76 return result;
77 }
78
79
80 @Override
81 public boolean equals(Object obj)
82 {
83 if (this == obj)
84 return true;
85 if (obj == null)
86 return false;
87 if (getClass() != obj.getClass())
88 return false;
89 RouteData/../../../org/opentrafficsim/sim0mq/kpi/RouteData.html#RouteData">RouteData other = (RouteData) obj;
90 if (this.routeName == null)
91 {
92 if (other.routeName != null)
93 return false;
94 }
95 else if (!this.routeName.equals(other.routeName))
96 return false;
97 return true;
98 }
99
100
101 @Override
102 public String toString()
103 {
104 return "RouteData [routeName=" + this.routeName + ", startNode=" + this.startNode + ", endNode=" + this.endNode + "]";
105 }
106
107 }