All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tw.edu.ncnu.im.cnclab.Algor.ShortestPath

java.lang.Object
   |
   +----tw.edu.ncnu.im.cnclab.Algor.Algorithm
           |
           +----tw.edu.ncnu.im.cnclab.Algor.ShortestPath

public abstract class ShortestPath
extends Algorithm
The abstract ShortestPath class define the Shortest path algorithm.

Version:
0.4 Jul 8, 1999
Author:
Ding-Yi Chen

Variable Index

 o drawNegativeLoop
 o FINISH_VISITED_COLOR
 o FIRST_TOUCHED_COLOR
 o OTHER
 o TREE_EDGE
 o verts

Constructor Index

 o ShortestPath()

Method Index

 o algorImpl()
Algorithm implement here.
 o getPreferredDialog(Graph, Frame)
Preferred dialog: AskVertexDialog.
 o relax(Graph, Vertex, Vertex)
 o setArg(Object[])
Set arguments from the argument list.

Variables

 o verts
 protected int verts
 o OTHER
 public static final Color OTHER
 o TREE_EDGE
 public static final Color TREE_EDGE
 o FIRST_TOUCHED_COLOR
 public static final Color FIRST_TOUCHED_COLOR
 o FINISH_VISITED_COLOR
 public static final Color FINISH_VISITED_COLOR
 o drawNegativeLoop
 protected boolean drawNegativeLoop

Constructors

 o ShortestPath
 public ShortestPath()

Methods

 o setArg
 protected void setArg(Object args[]) throws IllegalArgumentException
Set arguments from the argument list.

Valid args: null , Object[]{Integer(int startNode),Boolean(boolean drawTheNegativeLoop )}

Parameters:
args - The list of arguments.
Throws: IllegalArgumentException
Illegal argument defined.
Overrides:
setArg in class Algorithm
 o getPreferredDialog
 public GenericDialog getPreferredDialog(Graph graph,
                                         Frame fr)
Preferred dialog: AskVertexDialog.

Parameters:
graph - The Graph.
fr - The parent Frame.
Returns:
the preferred dialog.
Overrides:
getPreferredDialog in class Algorithm
 o relax
 protected double relax(Graph graph,
                        Vertex u,
                        Vertex v)
 o algorImpl
 protected abstract Object algorImpl() throws AlgorithmException
Algorithm implement here.

Returns:
the result of the algorithm.
Throws: AlgorithmException
Exception that throws by algorithm.
Overrides:
algorImpl in class Algorithm

All Packages  Class Hierarchy  This Package  Previous  Next  Index