revert(model): Path.concatenate
這個提交存在於:
父節點
8f7639cea4
當前提交
d0e970b2ab
共有 1 個檔案被更改,包括 2 行新增 和 2 行删除
|
|
@ -115,7 +115,7 @@ public class Path {
|
||||||
* map do not match, or the end of a path is not the beginning of the
|
* map do not match, or the end of a path is not the beginning of the
|
||||||
* next).
|
* next).
|
||||||
*/
|
*/
|
||||||
public static Path concatenate(int indice, Path... paths) throws IllegalArgumentException {
|
public static Path concatenate(Path... paths) throws IllegalArgumentException {
|
||||||
if (paths.length == 0) {
|
if (paths.length == 0) {
|
||||||
throw new IllegalArgumentException("Cannot concatenate an empty list of paths.");
|
throw new IllegalArgumentException("Cannot concatenate an empty list of paths.");
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +128,7 @@ public class Path {
|
||||||
}
|
}
|
||||||
ArrayList<Arc> arcs = new ArrayList<>();
|
ArrayList<Arc> arcs = new ArrayList<>();
|
||||||
for (Path path: paths) {
|
for (Path path: paths) {
|
||||||
arcs.addAll(indice, path.getArcs());
|
arcs.addAll(path.getArcs());
|
||||||
}
|
}
|
||||||
Path path = new Path(paths[0].getGraph(), arcs);
|
Path path = new Path(paths[0].getGraph(), arcs);
|
||||||
if (!path.isValid()) {
|
if (!path.isValid()) {
|
||||||
|
|
|
||||||
載入中…
新增問題並參考