JanosVM v1.0 API

edu.utah.janosvm.sys
Class EventQueue

java.lang.Object
  |
  +--edu.utah.janosvm.sys.List
        |
        +--edu.utah.janosvm.sys.EventQueue
All Implemented Interfaces:
java.lang.Runnable

final class EventQueue
extends List
implements java.lang.Runnable

An internal queue/dispatcher for events.

Author:
Tim Stack, Utah Janos Team
See Also:
EventHandler, Event

Fields inherited from class edu.utah.janosvm.sys.List
head, tail
 
Constructor Summary
(package private) EventQueue()
           
 
Method Summary
(package private)  Event dequeue()
          Fetch (and remove) the head event from this queue.
 void enqueue(Event event, EventHandler eh, int type)
          Enqueue an event.
 void run()
          Run the handler thread for this event queue.
 java.lang.String toString()
           
 
Methods inherited from class edu.utah.janosvm.sys.List
addHead, addTail, count, isEmpty, remHead, remTail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0
 

Constructor Detail

EventQueue

EventQueue()
Method Detail

enqueue

public void enqueue(Event event,
                    EventHandler eh,
                    int type)
Enqueue an event. Because the handler and type are stored in the event, do not enqueue the same event more than once.
Parameters:
event - An appropriately typed Event object to queue.
eh - The target of the event.
type - The type of event.

dequeue

Event dequeue()
Fetch (and remove) the head event from this queue.
Returns:
An Event from the front of the queue.

run

public void run()
Run the handler thread for this event queue. The handler thread will dequeue each event and run the event's associated {@linkplain Event#getHandler handler}.
Specified by:
run in interface java.lang.Runnable

toString

public java.lang.String toString()
Overrides:
toString in class List

JanosVM v1.0 API

This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003