edu.cmu.emulator.event
Class EmuEventThread

java.lang.Object
  extended by edu.cmu.emulator.event.EmuEventThread
All Implemented Interfaces:
Runnable

public class EmuEventThread
extends Object
implements Runnable

The thread that processes the Emulator events. Maintains a queue of events in the form of a splay tree. Executes events at the time specified within the event object.


Field Summary
private static boolean debug
           
private  long eventsAdded
           
private  ESplayTree eventSplayTree
           
private  long eventsRemovedBeforeExecution
           
private  long eventsRemovedForExecution
           
private  long lastEventTime
           
private  long nextEID
           
private  boolean running
           
private  int size
           
private static long SLEEP_RESOLUTION
           
private  Object synch
           
protected  Thread thisThread
           
 
Constructor Summary
EmuEventThread()
           
 
Method Summary
 void addEvents(ArrayList newEvents)
           
 void display()
           
 void displayStats()
           
private  void execEvent(EmuEvent event)
           
 long getEventsAdded()
           
 long getEventsRemovedBeforeExecution()
           
 long getEventsRemovedForExecution()
           
 EmuEvent getNextEvent()
           
 long getNextEventTime()
           
 void insertEvent(EmuEvent event)
           
 void removeEvent(EmuEvent event)
           
 void run()
           
 int size()
           
 Thread start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eventSplayTree

private ESplayTree eventSplayTree

running

private boolean running

synch

private Object synch

thisThread

protected Thread thisThread

SLEEP_RESOLUTION

private static final long SLEEP_RESOLUTION
See Also:
Constant Field Values

lastEventTime

private long lastEventTime

size

private int size

eventsAdded

private long eventsAdded

eventsRemovedBeforeExecution

private long eventsRemovedBeforeExecution

eventsRemovedForExecution

private long eventsRemovedForExecution

debug

private static final boolean debug
See Also:
Constant Field Values

nextEID

private long nextEID
Constructor Detail

EmuEventThread

public EmuEventThread()
Method Detail

start

public Thread start()

insertEvent

public void insertEvent(EmuEvent event)

removeEvent

public void removeEvent(EmuEvent event)

getNextEvent

public EmuEvent getNextEvent()

getNextEventTime

public long getNextEventTime()

addEvents

public void addEvents(ArrayList newEvents)
               throws IOException
Throws:
IOException

run

public void run()
Specified by:
run in interface Runnable

display

public void display()

size

public int size()

getEventsAdded

public long getEventsAdded()

getEventsRemovedBeforeExecution

public long getEventsRemovedBeforeExecution()

getEventsRemovedForExecution

public long getEventsRemovedForExecution()

displayStats

public void displayStats()

execEvent

private void execEvent(EmuEvent event)


Copyright © 2013. All Rights Reserved.