gshute.graph
Interface GraphSearchRecorder

All Known Implementing Classes:
SpanningTreeRecorder

public abstract interface GraphSearchRecorder

The GraphSearchRecorder interface defines the methods required for an object that records visitation and results in a graph search.

Implementations of this interface must declare instance variables for recording visited vertices and search results. They must also implement the following methods:


Method Summary
 void endSearch()
          rcrdr.endSearch() performs any necessary cleanup after a search.
 boolean isVisited(java.lang.Object v)
          isVisited(v) returns true if v has been visited.
 void revisit(java.lang.Object v, java.lang.Object via)
          revisit(v, via) records that v has been revisited, arriving at v through edge via.
 void startSearch(SearchableGraph sg)
          rcrdr.startSearch(sg) initializes rcrdr in preparation for searching sg.
 boolean visit(java.lang.Object v, java.lang.Object via)
          visit(v, via) records that v has been visited, arriving at v through edge via.
 

Method Detail

startSearch

public void startSearch(SearchableGraph sg)
rcrdr.startSearch(sg) initializes rcrdr in preparation for searching sg.

isVisited

public boolean isVisited(java.lang.Object v)
isVisited(v) returns true if v has been visited.

visit

public boolean visit(java.lang.Object v,
                     java.lang.Object via)
visit(v, via) records that v has been visited, arriving at v through edge via. Via is null when the start vertex is visited. If visited() returns true then a graph searcher will terminate its search.

revisit

public void revisit(java.lang.Object v,
                    java.lang.Object via)
revisit(v, via) records that v has been revisited, arriving at v through edge via.

endSearch

public void endSearch()
rcrdr.endSearch() performs any necessary cleanup after a search.