next up previous contents
Next: MyAwt Package Up: GraphStuff Package Previous: GraphAlgorithm Class

Algorithms Class

The Algorithms class provides an array of GraphAlgorithm objects to the NetWorKsPanel class. This very simple class provides the mechanism for adding new GraphAlgorithms to the NetWorKs program. Whenever a new GraphAlgorithm is developed, the new GraphAlgorithm is added to the array in the Algorithms class. This means that only the new class and the Algorithms class need be compiled.

package GraphStuff;

public class Algorithms {

   public static final GraphAlgorithm[] algs
     = {new Kruskal(),
        new Topological(),
        new Dijkstra(),
        new DepthFirst()};

}



Kelly Waters
Mon Oct 27 18:18:15 EST 1997