modsim
Class SimulatorThread

java.lang.Object
  extended by java.lang.Thread
      extended by modsim.SimulatorThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
AiaododiSimulator, F7Simulator

public abstract class SimulatorThread
extends java.lang.Thread

SimulatorThread

Author:
bburch 15 July 2008

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 javax.swing.JPanel panel
          Place for optional JPanel to place GUI images.
 SimulatedProcessImage processImage
          The process image that contains the memory map.
 boolean running
          flag for running the simulator.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SimulatorThread()
          Constructor.
 
Method Summary
static void pause(long milliseconds)
          Delay for milliseconds given.
 void run()
          Required by Thread.
 void setPanel(javax.swing.JPanel panel)
          Sets the JPanel where to place things.
 void setProcessImage(SimulatedProcessImage pi)
          Set the process image to use.
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

processImage

public SimulatedProcessImage processImage
The process image that contains the memory map.


panel

public javax.swing.JPanel panel
Place for optional JPanel to place GUI images.


running

public boolean running
flag for running the simulator.

Constructor Detail

SimulatorThread

public SimulatorThread()
Constructor. We need a null constructor for the class loader. Therefore, the process image must be set separately. The process image must be set BEFORE the simulator is started.

Parameters:
pi - ProcessImageImplementation
Method Detail

pause

public static void pause(long milliseconds)
Delay for milliseconds given. Puts Thread.sleep in a try/catch construct. This is useful, so it is exported.

Parameters:
milliseconds - long - number of milliseconds to delay

run

public void run()
Required by Thread. Provide a dummy routine which does not terminate.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

setPanel

public void setPanel(javax.swing.JPanel panel)
Sets the JPanel where to place things. This is optional for a GUI representation of the process map.

Parameters:
panel - JPanel

setProcessImage

public void setProcessImage(SimulatedProcessImage pi)
Set the process image to use.

Parameters:
pi - SimulatedProcessImage - memory map to use