DE.purple_sunshine.bigbro
Class SuspendableThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--DE.purple_sunshine.bigbro.SuspendableThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
Animator, CountdownAnimator, PositionLoader, Smily

public class SuspendableThread
extends java.lang.Thread

A thread that can be suspended and finished...

Since:
JDK1.1
Version:
1.0
Author:
Holger Wagner

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SuspendableThread()
           
 
Method Summary
 void finish()
          This should make the Thread leave its loop and thus finish. (
 boolean isFinished()
          Leaving the run method, the variable finished should be set to true.
 void resume_()
          suspended is reset to false, so the Thread should leave the sleep-loop and start working again.
 void suspend_()
          If the subclass is correctly implemented using the suspended boolean variable, the Thread will finish all its tasks and then remain in a sleep-mode until its resumed. (
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SuspendableThread

public SuspendableThread()
Method Detail

suspend_

public void suspend_()
If the subclass is correctly implemented using the suspended boolean variable, the Thread will finish all its tasks and then remain in a sleep-mode until its resumed. (suspended = true)

resume_

public void resume_()
suspended is reset to false, so the Thread should leave the sleep-loop and start working again.

finish

public void finish()
This should make the Thread leave its loop and thus finish. (finishing = true)

isFinished

public boolean isFinished()
Leaving the run method, the variable finished should be set to true. If that was done, the Thread can be queried on whether or not its finished, yet, with this method.


© 2000, Holger Wagner, Purple Sunshine Productions.