fr.lifl.jedi.controllersCore.util
Class EventFIFO

java.lang.Object
  extended by java.lang.Thread
      extended by fr.lifl.jedi.controllersCore.util.EventFIFO
All Implemented Interfaces:
java.lang.Runnable

public class EventFIFO
extends java.lang.Thread

A FIFO stack of events used by an event notified instance (see EventNotified).

This class provides a thread that stores a stack of events. The run method of this class is an infinite loop that pops an event from the stack, handles it, until the stack is empty, and then waits for new events to appear.

Version:
JEDI V 2.2
Created the 17th nov. 2008
Modified the 5th may 2009
Author:
Yoann Kubera
SMAC Team (Systèmes Multi-Agents et Comportement)
LIFL (Laboratoire d'Informatique Fondamentale de Lille)
University of Lille, France

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EventFIFO(EventNotified notified)
          Constructor of an event fifo stack.
 
Method Summary
 void registerEvent(java.util.Observable o, java.lang.Object e)
          Registers an event in this event stack.
 void run()
           
 
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
 

Constructor Detail

EventFIFO

public EventFIFO(EventNotified notified)
Constructor of an event fifo stack.

Parameters:
notified - The element associated with that event stack. To handle events, the stack will call the EventNotified.processEvent(Observable, Object) method of this parameter.
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
See Also:
Thread.run()

registerEvent

public void registerEvent(java.util.Observable o,
                          java.lang.Object e)
Registers an event in this event stack.

Parameters:
o - The observable from which the event comes.
e - The event added to this event stack.