update isValid()
This commit is contained in:
parent
b65f6c27ca
commit
6613be4663
1 changed files with 2 additions and 2 deletions
|
|
@ -189,11 +189,11 @@ public class Path {
|
|||
|
||||
if (this.isEmpty()) { return true; }
|
||||
if (this.size() == 1 && this.arcs.isEmpty()) { return true; }
|
||||
if (this.arcs.get(0).getOrigin() != this.origin) { return false; }
|
||||
if (!this.arcs.get(0).getOrigin().equals(this.origin)) { return false; }
|
||||
|
||||
Boolean good = true;
|
||||
for (int i = 0; i < this.arcs.size() - 1; i++) {
|
||||
if (this.arcs.get(i).getDestination() != this.arcs.get(i+1).getOrigin()) {
|
||||
if (!this.arcs.get(i).getDestination().equals(this.arcs.get(i+1).getOrigin())) {
|
||||
good = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue