Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.phoenixst.plexus
Interface TraverserFactory  view TraverserFactory download TraverserFactory.java

All Known Subinterfaces:
GraphUtils.SerializableTraverserFactory

public interface TraverserFactory

An interface used to encapsulate a particular type of Traverser, so that it may be used without knowledge of its implementation. See java.util.Comparator for a similar, but simpler, information hiding construct used in ordering collections.

This allows graph algorithms to not have different implementations for undirected, forward directed, and reverse directed traversals, for example. The user may also create custom TraverserFactory objects to be used in non-trivial traversals. As an example, a graph representing a system of roads may be traversed by only following four-lane highways (a particular sort of object contained in the graph's edges), and the traversal may still be performed using a generic algorithm.

This interface is a trivially small example of the Abstract Factory pattern (see Design Patterns, by Gamma, et. al.).

Since:
1.0
Version:
$Revision: 1.2 $

Method Summary
 Traverser createTraverser(Graph graph, java.lang.Object node)
          Returns a Traverser initialized using graph and node.
 

Method Detail

createTraverser

public Traverser createTraverser(Graph graph,
                                 java.lang.Object node)
Returns a Traverser initialized using graph and node.