|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javautils.graph.templates.TimedSearchTemplate
An abstract Template Method [Gamma1995] for searching directed graphs in a timed fashion.
Field Summary | |
protected Dispenser |
eventDispenser
The derived class should directly push any events into this event dispenser. |
protected Graph |
graph
The graph being searched. |
Constructor Summary | |
protected |
TimedSearchTemplate(Graph graph,
java.util.Iterator roots,
Dispenser eventDispenser)
A new timed search template. |
Method Summary | |
protected void |
beginRoot(java.lang.Object node,
IntHolder time)
Called once for each root drawn from the root dispenser that has not already been done. |
protected void |
endRoot(java.lang.Object node,
IntHolder time)
Called once for root that was begun after the search has finished handling all events generated from the root. |
protected abstract void |
handleEdge(java.lang.Object edge,
java.lang.Object target,
IntHolder timeOfTarget)
Called once for each edge event drawn from the event dispenser. |
protected abstract void |
handleNode(java.lang.Object node,
IntHolder time)
Called once for each node event drawn from the event dispenser. |
protected IntHolder |
newInitialTime()
Called to create a new IntHolder -instance for each edge
before the search. |
protected boolean |
notDone(IntHolder time)
True if and only if the time indicates that associated node hasn't already been done or discovered. |
protected void |
prepareNode(java.lang.Object node)
Called once for each node before the search. |
void |
search()
Performs the search calling the event point methods. |
protected IntHolder |
timeOf(java.lang.Object node)
The time associated with the node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final Graph graph
The graph being searched.
protected final Dispenser eventDispenser
The derived class should directly push any events into this event dispenser. The timed search template then pops events from this dispenser and calls the appropriate event handling method.
Constructor Detail |
protected TimedSearchTemplate(Graph graph, java.util.Iterator roots, Dispenser eventDispenser)
A new timed search template.
Method Detail |
protected void prepareNode(java.lang.Object node)
Called once for each node before the search.
protected void beginRoot(java.lang.Object node, IntHolder time)
Called once for each root drawn from the root dispenser that has not already been done.
protected void endRoot(java.lang.Object node, IntHolder time)
Called once for root that was begun after the search has finished handling all events generated from the root.
protected abstract void handleNode(java.lang.Object node, IntHolder time)
Called once for each node event drawn from the event dispenser.
protected abstract void handleEdge(java.lang.Object edge, java.lang.Object target, IntHolder timeOfTarget)
Called once for each edge event drawn from the event dispenser.
public final void search()
Performs the search calling the event point methods.
protected IntHolder newInitialTime()
Called to create a new IntHolder
-instance for each edge
before the search. By default the initial time is 0.
notDone(javautils.holders.IntHolder)
protected boolean notDone(IntHolder time)
True if and only if the time indicates that associated node hasn't already been done or discovered. By default a node is considered done if the time is not 0.
newInitialTime()
protected final IntHolder timeOf(java.lang.Object node)
The time associated with the node.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |