Gets the place that is not equal to p in a path @param p @return place of path that is not p @throws RuntimeException
(Place p)
| 102 | * @throws RuntimeException |
| 103 | */ |
| 104 | public Place getOtherPlace(Place p) throws RuntimeException{ |
| 105 | if(places[0] == p) return places[1]; |
| 106 | else if(places[1] == p) return places[0]; |
| 107 | else throw new RuntimeException("Place not found in path"); |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Removes this path from both places |
no outgoing calls