Gets the exit direction of a place p used in this path @param p @return the exit direction of p in the path @throws RuntimeException if the place isn't a member of the path
(Place p)
| 90 | * @throws RuntimeException if the place isn't a member of the path |
| 91 | */ |
| 92 | public String getExit(Place p) throws RuntimeException{ |
| 93 | if(places[0] == p) return exitdirections[0]; |
| 94 | else if(places[1] == p) return exitdirections[1]; |
| 95 | else throw new RuntimeException("Place not found in path"); |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Gets the place that is not equal to p in a path |
no outgoing calls