public Path extract ( ) { if ( isFound ( ) ) throw new IllegalStateException ( "Extract can only be called once" ) ; extractSW . start ( ) ; SPTEntry currEdge = sptEntry ; setEndNode ( currEdge . adjNode ) ; boolean nextEdgeValid = EdgeIterator . Edge . isValid ( currEdge . edge ) ; int nextEdge ; while ( nextEdgeValid ) { // the reverse search needs the next edge nextEdgeValid = EdgeIterator . Edge . isValid ( currEdge . parent . edge ) ; nextEdge = nextEdgeValid ? currEdge . parent . edge : EdgeIterator . NO_EDGE ; processEdge ( currEdge . edge , currEdge . adjNode , nextEdge ) ; currEdge = currEdge . parent ; } setFromNode ( currEdge . adjNode ) ; reverseOrder ( ) ; extractSW . stop ( ) ; return setFound ( true ) ; }
Extracts the Path from the shortest - path - tree determined by sptEntry .