|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mascoptLib.algos.abstractalgos.StepAlgo
StepAlgo is a class wich provides a way of running an algorithm step by step. The goal is to implement an algorithm in two way: the common way where the algorithm is running as fast as possible. The other way is to debug or to perform demos. We want in this case, pause each step of the algo during some seconds. This class implements this behavior. Note that this class is derivated from Runnable wich implement the Thread system.
Constructor Summary | |
StepAlgo()
Default constructor. |
|
StepAlgo(boolean byStep)
Default constructor. |
Method Summary | |
void |
byStep(boolean byStep)
Change the algorithm behavior to run step by step. |
void |
ends(boolean end)
Change the algorithm statut for end to a boolean. |
boolean |
isDemo()
Say if the algorithm is in demo mode ie step by step. |
boolean |
isEnded()
As the algorithm is run as a thread, we want to know when it ends. |
void |
nextStep()
When calling nextStep, the algorithm is unpaused. |
abstract void |
run()
Run the algorithm. |
void |
setTime(int time)
Set wait time in miliseconds |
void |
start()
Launch the algorithm |
void |
waitB()
Give a method to put a pause in your algorithm. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StepAlgo()
public StepAlgo(boolean byStep)
Method Detail |
public void setTime(int time)
time
- the time to wait beetween stepspublic void start()
public void nextStep()
public boolean isEnded()
public void ends(boolean end)
end
- the statut to store.public void byStep(boolean byStep)
public boolean isDemo()
public void waitB()
public abstract void run()
run
in interface Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |