|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
PlaybackThread
public class PlaybackThread
This is a thread class that keeps executing moves in the playback moves list until no further moves remain.
Playback
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
(package private) long |
defaultSleepTime
Default length of time (in ms) to sleep between each move |
(package private) long |
sleepTime
Length of time (in ms) to sleep between each move |
(package private) boolean |
stop
Stops the thread if set to true |
(package private) Playback |
thePlayback
The Playback object to execute moves from |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
PlaybackThread(Playback pb)
Constructor sets the playback object and sets the sleeptime to its default value. |
|
PlaybackThread(Playback pb,
long speed)
Constructor sets the playback object and sets the sleeptime to the passed in value. |
Method Summary | |
---|---|
void |
changeSpeed(long newSpeed)
Changes the sleeptime to the passed in value. |
void |
run()
This function fires whenever the thread is started and continually moves through moves in playback's move list until no further moves remain or the thread is stopped. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 |
---|
boolean stop
true
long sleepTime
final long defaultSleepTime
Playback thePlayback
Constructor Detail |
---|
public PlaybackThread(Playback pb)
pb
- The Playback object to execute moves frompublic PlaybackThread(Playback pb, long speed)
pb
- The playback object to execute moves fromspeed
- The sleep time between moves (in ms)Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
Playback
public void changeSpeed(long newSpeed)
newSpeed
- New sleeptime between moves (in ms)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |