|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.hawaii.ics.yucheng.GraphSolver
abstract class GraphSolver
An abstract class that solves graphs.
Field Summary | |
---|---|
private long |
myBroadcast
|
private java.util.ArrayList<GraphListener> |
myListeners
|
private long |
mySleepTime
|
private long |
myTimeout
|
Constructor Summary | |
---|---|
GraphSolver()
|
Method Summary | |
---|---|
void |
addGraphListener(GraphListener listener)
Adds a listener for progress messages. |
boolean |
isAnimating()
Returns true if the solver is animating. |
protected void |
publish(GraphSolution solution)
Publishes progress to all added listeners. |
void |
removeGraphListener(GraphListener listener)
Removes a progress listener. |
private static void |
sleep(long milliseconds)
Sleeps for a number of milliseconds. |
abstract GraphSolution |
solve(Graph g)
Solves a graph or returns null if there is no solution. |
void |
startAnimation(long timeout)
Starts animation. |
void |
startAnimation(long timeout,
long sleepTime)
Starts animation. |
void |
stopAnimation()
Stops animation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private long myBroadcast
private final java.util.ArrayList<GraphListener> myListeners
private long mySleepTime
private long myTimeout
Constructor Detail |
---|
GraphSolver()
Method Detail |
---|
private static void sleep(long milliseconds)
milliseconds
- The number of milliseconds to sleep.public void addGraphListener(GraphListener listener)
listener
- The listener.public boolean isAnimating()
protected void publish(GraphSolution solution)
solution
- The solution.public void removeGraphListener(GraphListener listener)
listener
- The listener.public abstract GraphSolution solve(Graph g)
g
- The graph.
public void startAnimation(long timeout)
timeout
- The amount of time to delay before transmitting progress.public void startAnimation(long timeout, long sleepTime)
timeout
- The amount of time to delay before transmitting progress.sleepTime
- The amount of time to sleep after transmitting progress.public void stopAnimation()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |