org.jlab.coda.et
Class EventList

java.lang.Object
  extended byorg.jlab.coda.et.EventList

class EventList
extends java.lang.Object

This class defines a linked list of events for use as either a station's input or output list in a station.


Field Summary
(package private)  java.util.LinkedList events
          Linked list of events.
(package private)  long eventsIn
          Number of events put into this list.
(package private)  long eventsOut
          Number of events taken out of this list.
(package private)  long eventsTry
          Number of events tried to put into this list when used with prescaling.
(package private)  boolean locked
          Flag telling if the list is locked by a user reading events from it.
 
Constructor Summary
(package private) EventList()
          Creates a new EventList object.
 
Method Summary
(package private)  void get(java.util.ArrayList eventsToGo)
          Used only by conductor to get all events from a station's output list.
(package private)  Event[] get(AttachmentLocal att, int mode, int microSec, int quantity)
          For an attachment (in TcpServer thread) to get an array of events.
(package private)  void put(java.util.ArrayList newEvents)
          For user to put all events into station's output list.
(package private)  void put(Event[] newEvents)
          For user to put all events into station's output list.
(package private)  void putAll(java.util.List newEvents)
          Put all events into the list regardless of how many are already in it.
(package private)  void putInGC(Event[] newEvents)
          Synchronized version of putInLow for user to dump events into GRAND_CENTRAL station.
(package private)  void putInGC(java.util.List newEvents)
          Synchronized version of putInLow for user to dump events into GRAND_CENTRAL station.
(package private)  void putInLow(java.util.List newEvents)
          Put all events into a station's input list as low priority.
(package private)  void wakeUp(AttachmentLocal att)
          Wake up an attachment waiting to read events from this list.
(package private)  void wakeUpAll()
          Wake up all attachments waiting to read events from this list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

events

java.util.LinkedList events
Linked list of events.


eventsIn

long eventsIn
Number of events put into this list.


eventsOut

long eventsOut
Number of events taken out of this list.


eventsTry

long eventsTry
Number of events tried to put into this list when used with prescaling.


locked

volatile boolean locked
Flag telling if the list is locked by a user reading events from it.

Constructor Detail

EventList

EventList()
Creates a new EventList object.

Method Detail

wakeUp

void wakeUp(AttachmentLocal att)
Wake up an attachment waiting to read events from this list.

Parameters:
att - attachment to be woken up

wakeUpAll

void wakeUpAll()
Wake up all attachments waiting to read events from this list.


putInLow

void putInLow(java.util.List newEvents)
Put all events into a station's input list as low priority. This is synchronized and used in conductor threads and in the initial filling of GRAND_CENTRAL station.

Parameters:
newEvents - list of events to put

putInGC

void putInGC(Event[] newEvents)
Synchronized version of putInLow for user to dump events into GRAND_CENTRAL station.

Parameters:
newEvents - array of events to put

putInGC

void putInGC(java.util.List newEvents)
Synchronized version of putInLow for user to dump events into GRAND_CENTRAL station.

Parameters:
newEvents - list of events to put

putAll

void putAll(java.util.List newEvents)
Put all events into the list regardless of how many are already in it. Synchronized and used only in conductor threads to put events into a station's input list. All high priority events are listed first in newEvents.

Parameters:
newEvents - list of events to put

put

void put(Event[] newEvents)
For user to put all events into station's output list. High & low priorities may be mixed up in the newEvents list. May also be used to restore events to the input list when user connection is broken.

Parameters:
newEvents - array of events to put

put

void put(java.util.ArrayList newEvents)
For user to put all events into station's output list. High & low priorities may be mixed up in the newEvents list. May also be used to restore events to the input list when user connection is broken.

Parameters:
newEvents - list of events to put

get

void get(java.util.ArrayList eventsToGo)
Used only by conductor to get all events from a station's output list.

Parameters:
eventsToGo - list of event to get

get

Event[] get(AttachmentLocal att,
            int mode,
            int microSec,
            int quantity)
      throws EtEmptyException,
             EtWakeUpException,
             EtTimeoutException
For an attachment (in TcpServer thread) to get an array of events.

Parameters:
att - attachment
mode - wait mode
microSec - time in microseconds to wait if timed wait mode
quantity - number of events desired
Throws:
EtEmptyException - if the mode is asynchronous and the station's input list is empty
EtTimeoutException - if the mode is timed wait and the time has expired
EtWakeUpException - if the attachment has been commanded to wakeup,