edu.cornell.cs.sam.ui
Class SamGUI.RunThread

java.lang.Object
  extended by java.lang.Thread
      extended by edu.cornell.cs.sam.utils.SamThread
          extended by edu.cornell.cs.sam.ui.SamGUI.RunThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
SamGUI

public class SamGUI.RunThread
extends SamThread

Allows a GUI to run a program with breakpoints and with the ability to stop execution at any time


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.cornell.cs.sam.utils.SamThread
SamThread.ThreadParent
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  SamGUI.BreakpointList breakpoints
          A list of all current breakpoints.
protected  int delay
          The delay after each intruction
protected  Processor proc
          Provides access to the processor
protected  Sys sys
          Provides access to the system
static int THREAD_BREAKPOINT
           
static int THREAD_STEP
           
 
Fields inherited from class edu.cornell.cs.sam.utils.SamThread
THREAD_EXCEPTION, THREAD_EXIT_OK, THREAD_INTERRUPTED
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SamGUI.RunThread(SamThread.ThreadParent parent, Sys sys, int delay)
          Creates a new thread
 
Method Summary
 void execute()
          Starts the thread
 SamGUI.BreakpointList getBreakpointList()
           
 void setBreakpointList(SamGUI.BreakpointList l)
           
 
Methods inherited from class edu.cornell.cs.sam.utils.SamThread
clearInterrupt, getParent, interrupt, interruptRequested, run, setParent
 
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, 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

proc

protected Processor proc
Provides access to the processor


sys

protected Sys sys
Provides access to the system


delay

protected int delay
The delay after each intruction


breakpoints

protected SamGUI.BreakpointList breakpoints
A list of all current breakpoints. When RunThread encounters a breakpoint it interrupts execution.


THREAD_BREAKPOINT

public static final int THREAD_BREAKPOINT
See Also:
Constant Field Values

THREAD_STEP

public static final int THREAD_STEP
See Also:
Constant Field Values
Constructor Detail

SamGUI.RunThread

public SamGUI.RunThread(SamThread.ThreadParent parent,
                        Sys sys,
                        int delay)
Creates a new thread

Parameters:
parent - the frontend that needs to be updated
sys - the system to use
delay - # of milliseconds between command execution
Method Detail

setBreakpointList

public void setBreakpointList(SamGUI.BreakpointList l)

getBreakpointList

public SamGUI.BreakpointList getBreakpointList()

execute

public void execute()
             throws java.lang.Exception
Starts the thread

Specified by:
execute in class SamThread
Throws:
java.lang.Exception