diff --git a/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java b/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java index 1d84e84..7d7e2d2 100644 --- a/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java +++ b/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java @@ -201,8 +201,26 @@ public class Path { * @deprecated Need to be implemented. */ public boolean isValid() { - // TODO: - return false; + + boolean retour = false; + + if (isEmpty() || this.size() == 1) { + retour = true; + } else { + retour = true; + if (this.getOrigin() == this.arcs.get(0).getOrigin()) { + for (int j = 0 ; j < arcs.size() - 2 ; j++) { + if (!(arcs.get(j).getDestination() == arcs.get(j+1).getOrigin())) { + retour = false; + } + } + } + else { + retour = false; + } + } + + return retour; } /**