4
4
import org .opentripplanner .routing .location .TemporaryStreetLocation ;
5
5
import org .opentripplanner .routing .vertextype .StreetVertex ;
6
6
import org .opentripplanner .routing .vertextype .TemporarySplitterVertex ;
7
- import org .opentripplanner .routing .vertextype .TemporaryVertex ;
8
7
import org .opentripplanner .util .I18NString ;
9
8
10
9
final public class TemporaryPartialStreetEdge extends PartialStreetEdge implements TemporaryEdge {
11
- final private Boolean endEdge ; // A null value means that the vertices are temporary themselves
12
-
13
10
public TemporaryPartialStreetEdge (StreetEdge parentEdge , TemporaryStreetLocation v1 ,
14
11
TemporaryStreetLocation v2 , LineString geometry , I18NString name , double length ) {
15
12
super (parentEdge , v1 , v2 , geometry , name , length );
16
13
17
14
if (v1 .isEndVertex ()) {
18
15
throw new IllegalStateException ("A temporary edge is directed away from an end vertex" );
19
- } else if (v2 .isEndVertex ()) {
20
- endEdge = null ;
21
- } else {
16
+ } else if (!v2 .isEndVertex ()) {
22
17
throw new IllegalStateException ("A temporary edge is directed towards a start vertex" );
23
18
}
24
19
}
@@ -29,8 +24,6 @@ public TemporaryPartialStreetEdge(StreetEdge parentEdge, TemporaryStreetLocation
29
24
30
25
if (v1 .isEndVertex ()) {
31
26
throw new IllegalStateException ("A temporary edge is directed away from an end vertex" );
32
- } else {
33
- endEdge = false ;
34
27
}
35
28
}
36
29
@@ -40,18 +33,14 @@ public TemporaryPartialStreetEdge(StreetEdge parentEdge, TemporarySplitterVertex
40
33
41
34
if (v1 .isEndVertex ()) {
42
35
throw new IllegalStateException ("A temporary edge is directed away from an end vertex" );
43
- } else {
44
- endEdge = false ;
45
36
}
46
37
}
47
38
48
39
public TemporaryPartialStreetEdge (StreetEdge parentEdge , StreetVertex v1 ,
49
40
TemporaryStreetLocation v2 , LineString geometry , I18NString name , double length ) {
50
41
super (parentEdge , v1 , v2 , geometry , name , length );
51
42
52
- if (v2 .isEndVertex ()) {
53
- endEdge = true ;
54
- } else {
43
+ if (!v2 .isEndVertex ()) {
55
44
throw new IllegalStateException ("A temporary edge is directed towards a start vertex" );
56
45
}
57
46
}
@@ -60,24 +49,11 @@ public TemporaryPartialStreetEdge(StreetEdge parentEdge, StreetVertex v1,
60
49
TemporarySplitterVertex v2 , LineString geometry , I18NString name , double length ) {
61
50
super (parentEdge , v1 , v2 , geometry , name , length );
62
51
63
- if (v2 .isEndVertex ()) {
64
- endEdge = true ;
65
- } else {
52
+ if (!v2 .isEndVertex ()) {
66
53
throw new IllegalStateException ("A temporary edge is directed towards a start vertex" );
67
54
}
68
55
}
69
56
70
- @ Override
71
- public void dispose () {
72
- if (endEdge != null ) {
73
- if (endEdge ) {
74
- fromv .removeOutgoing (this );
75
- } else {
76
- tov .removeIncoming (this );
77
- }
78
- }
79
- }
80
-
81
57
@ Override
82
58
public String toString () {
83
59
return "Temporary" + super .toString ();
0 commit comments