A method to check if there is a path from a given node to another node @param from the start node for checking @param to the end node for checking @return true if path exists, false otherwise
(E from, E to)
| 369 | * @return true if path exists, false otherwise |
| 370 | */ |
| 371 | public boolean pathExists(E from, E to) { |
| 372 | List<E> successors = getSuccessors(from); |
| 373 | if(successors == null || successors.size() == 0) { |
| 374 | return false; |
| 375 | } |
| 376 | for (E successor : successors) { |
| 377 | if(successor.equals(to) |
| 378 | || pathExists(successor, to)) { |
| 379 | return true; |
| 380 | } |
| 381 | } |
| 382 | return false; |
| 383 | } |
| 384 | |
| 385 | public Iterator<E> iterator() { |
| 386 | return mOps.keySet().iterator(); |
nothing calls this directly
no test coverage detected