@@ -13,10 +13,11 @@ public final class DistancesConfiguration implements Serializable {
13
13
private DistancesOutputConfiguration outputConfig = new DistancesOutputConfiguration ();
14
14
private GreatCircleConfiguration greatCircleConfig = new GreatCircleConfiguration ();
15
15
private GraphhopperConfiguration graphhopperConfig = new GraphhopperConfiguration ();
16
-
16
+ private ExternalMatrixFileConfiguration externalConfig = new ExternalMatrixFileConfiguration ();
17
17
public enum CalculationMethod {
18
18
GREAT_CIRCLE ("Crow fly distance (along the surface of the Earth) from one lat/long pair to another" ),
19
- ROAD_NETWORK ("Use a road network, calculated using the Graphhopper library" );
19
+ ROAD_NETWORK ("Use a road network, calculated using the Graphhopper library" ),
20
+ EXTERNAL_MATRIX ("Use an external text file contain a matrix of distance and time values" );
20
21
21
22
private final String description ;
22
23
@@ -39,6 +40,10 @@ public DistancesConfiguration deepCopy(){
39
40
if (graphhopperConfig !=null ){
40
41
ret .graphhopperConfig = graphhopperConfig .deepCopy ();
41
42
}
43
+
44
+ if (externalConfig !=null ){
45
+ ret .externalConfig = externalConfig .deepCopy ();
46
+ }
42
47
return ret ;
43
48
}
44
49
@@ -81,6 +86,10 @@ public int hashCode() {
81
86
result = prime * result + graphhopperConfig .hashCode ();
82
87
break ;
83
88
89
+ case EXTERNAL_MATRIX :
90
+ result = prime * result + externalConfig .hashCode ();
91
+ break ;
92
+
84
93
default :
85
94
throw new RuntimeException ();
86
95
}
@@ -119,6 +128,11 @@ public boolean equals(Object obj) {
119
128
}
120
129
break ;
121
130
131
+ case EXTERNAL_MATRIX :
132
+ if (!other .externalConfig .equals (externalConfig )){
133
+ return false ;
134
+ }
135
+ break ;
122
136
default :
123
137
throw new RuntimeException ();
124
138
}
@@ -133,6 +147,14 @@ public GraphhopperConfiguration getGraphhopperConfig() {
133
147
public void setGraphhopperConfig (GraphhopperConfiguration graphhopperConfig ) {
134
148
this .graphhopperConfig = graphhopperConfig ;
135
149
}
150
+
151
+ public ExternalMatrixFileConfiguration getExternalConfig () {
152
+ return externalConfig ;
153
+ }
154
+
155
+ public void setExternalConfig (ExternalMatrixFileConfiguration externalConfig ) {
156
+ this .externalConfig = externalConfig ;
157
+ }
136
158
137
159
138
160
}
0 commit comments