javautils.graph.templates
Class AdjacentIterTemplate

java.lang.Object
  |
  +--javautils.graph.templates.AdjacentIterTemplate

public abstract class AdjacentIterTemplate
extends java.lang.Object

An abstract Template Method [Gamma1995] for iterating a graph based on the adjacency structure of the graph. Iteration based on the adjacency structure has some highly useful properties that make it worth implementing once as a template method.


Constructor Summary
AdjacentIterTemplate()
           
 
Method Summary
protected abstract  void beginNode(java.lang.Object node)
          Called once for each node before calling doEdge for each edge from the node.
protected abstract  void doEdge(java.lang.Object edge)
          Called once for each edge from a node.
protected abstract  void finishNode(java.lang.Object node)
          Called once for each node after all edges from the node have been done.
 void iter(Graph graph)
          Iterates over the graph and calls the event point methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdjacentIterTemplate

public AdjacentIterTemplate()
Method Detail

beginNode

protected abstract void beginNode(java.lang.Object node)

Called once for each node before calling doEdge for each edge from the node.


doEdge

protected abstract void doEdge(java.lang.Object edge)

Called once for each edge from a node.


finishNode

protected abstract void finishNode(java.lang.Object node)

Called once for each node after all edges from the node have been done.


iter

public final void iter(Graph graph)

Iterates over the graph and calls the event point methods.