GoGraph
v1.0


gograph.algorithms.courses
Class GenCourse

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--gograph.algorithms.courses.GenCourse
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
BreadthCourse, DepthCourse, MST, SPT

public abstract class GenCourse
extends java.lang.Thread

Abstract general course algorithm thread.

See Also:
GoGraph, GGPriorityQueue

Field Summary
protected  GoGraph gograph
          Access back to GoGraph panel.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
GenCourse(GoGraph gograph, java.lang.String name)
          Creates a new instance of GenCourse.
 
Method Summary
 void beingVisitedVertex(GGModel model, java.lang.Object vertex)
          Set a vertex to "beingVisited" state.
abstract  void computePriority(GGModel model, org.jgraph.graph.GraphCell vertex1, org.jgraph.graph.GraphCell vertex2)
          Priority function for priority queue.
 javax.swing.table.TableModel getPrioQueue()
          Get the priority queue used in algorithm.
 boolean getShowPriority()
          Get the priority visualisation flag.
abstract  java.lang.String getText(int i)
           
 void run()
          General course algorithm implementation.
 void seeVertex(GGModel model, java.lang.Object vertex)
          Set a vertex to "seen" state.
 void setShowPriority(boolean isShowPriority)
          Set the priority visualisation flag.
 void toNextVertex(GGModel model, java.lang.Object edge)
          Set an edge to "toNextVertex" state.
 void useEdge(GGModel model, java.lang.Object edge)
          Set an edge to "used" state.
 void visitVertex(GGModel model, java.lang.Object vertex)
          Set a vertex to "visited" state.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

gograph

protected GoGraph gograph
Access back to GoGraph panel.

Constructor Detail

GenCourse

public GenCourse(GoGraph gograph,
                 java.lang.String name)
Creates a new instance of GenCourse.

Parameters:
gograph - Access back to GoGraph panel.
name - Algorithm name.
Method Detail

run

public void run()
General course algorithm implementation.

Waits on AlgoNextAction for stepping.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

visitVertex

public void visitVertex(GGModel model,
                        java.lang.Object vertex)
Set a vertex to "visited" state.

Parameters:
model - Graph model.
vertex - Vertex to be set.

seeVertex

public void seeVertex(GGModel model,
                      java.lang.Object vertex)
Set a vertex to "seen" state.

Parameters:
model - Graph model.
vertex - Vertex to be set.

beingVisitedVertex

public void beingVisitedVertex(GGModel model,
                               java.lang.Object vertex)
Set a vertex to "beingVisited" state.

Parameters:
model - Graph model.
vertex - Vertex to be set.

toNextVertex

public void toNextVertex(GGModel model,
                         java.lang.Object edge)
Set an edge to "toNextVertex" state.

Parameters:
model - Graph model.
edge - Edge to be set.

useEdge

public void useEdge(GGModel model,
                    java.lang.Object edge)
Set an edge to "used" state.

Parameters:
model - Graph model.
edge - Edge to be set.

setShowPriority

public void setShowPriority(boolean isShowPriority)
Set the priority visualisation flag.

Parameters:
isShowPriority - Boolean to set flag with.

getShowPriority

public boolean getShowPriority()
Get the priority visualisation flag.

Returns:
Priority visualisation flag.

getPrioQueue

public javax.swing.table.TableModel getPrioQueue()
Get the priority queue used in algorithm.

Returns:
Priority queue used in algorithm.

computePriority

public abstract void computePriority(GGModel model,
                                     org.jgraph.graph.GraphCell vertex1,
                                     org.jgraph.graph.GraphCell vertex2)
Priority function for priority queue.

Parameters:
model - Graph model.
vertex1 - Vertex whose priority is evaluated.
vertex2 - Being visited vertex.

getText

public abstract java.lang.String getText(int i)

GoGraph
v1.0


Copyright (C) 2003 Stewe Frei. All rights reserved.