javautils.graph.templates
Class NodesAndEdgesIterTemplate

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

public abstract class NodesAndEdgesIterTemplate
extends java.lang.Object

An abstract Template Method [Gamma1995] for iterating over all nodes and edges of a graph.


Constructor Summary
NodesAndEdgesIterTemplate()
           
 
Method Summary
protected  void doBetween()
          Called once between switching from nodes to edges or vice versa.
protected abstract  void doEdge(java.lang.Object edge)
          Called once for each edge.
protected abstract  void doNode(java.lang.Object node)
          Called once for each node.
 void iter(Graph graph)
          First does all nodes, then does all edges.
 void iterEdgesThenNodes(Graph graph)
          First does all edges, then does all nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodesAndEdgesIterTemplate

public NodesAndEdgesIterTemplate()
Method Detail

doNode

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

Called once for each node.


doBetween

protected void doBetween()

Called once between switching from nodes to edges or vice versa.


doEdge

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

Called once for each edge.


iter

public final void iter(Graph graph)

First does all nodes, then does all edges.


iterEdgesThenNodes

public final void iterEdgesThenNodes(Graph graph)

First does all edges, then does all nodes.