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(String routeName, NodeData startNode, NodeData endNode)
32 {
33 super();
34 this.routeName = routeName;
35 this.startNode = startNode;
36 this.endNode = endNode;
37 }
38
39
40
41
42 public final String getRouteName()
43 {
44 return this.routeName;
45 }
46
47
48
49
50 public final NodeData getStartNode()
51 {
52 return this.startNode;
53 }
54
55
56
57
58 public final NodeData getEndNode()
59 {
60 return this.endNode;
61 }
62
63
64 @Override
65 public String getId()
66 {
67 return this.routeName;
68 }
69
70
71 @Override
72 public int hashCode()
73 {
74 final int prime = 31;
75 int result = 1;
76 result = prime * result + ((this.routeName == null) ? 0 : this.routeName.hashCode());
77 return result;
78 }
79
80
81 @Override
82 public boolean equals(Object obj)
83 {
84 if (this == obj)
85 return true;
86 if (obj == null)
87 return false;
88 if (getClass() != obj.getClass())
89 return false;
90 RouteData other = (RouteData) obj;
91 if (this.routeName == null)
92 {
93 if (other.routeName != null)
94 return false;
95 }
96 else if (!this.routeName.equals(other.routeName))
97 return false;
98 return true;
99 }
100
101
102 @Override
103 public String toString()
104 {
105 return "RouteData [routeName=" + this.routeName + ", startNode=" + this.startNode + ", endNode=" + this.endNode + "]";
106 }
107
108 }