javax.realtime.DSS
Class WaiterSet

java.lang.Object
  extended byjavax.realtime.DSS.WaiterSet
Direct Known Subclasses:
FIFOWaiterSet, PriorityWaiterSet

public abstract class WaiterSet
extends java.lang.Object

Abstract base class for sets of RealtimeThread's. Subclasses apply particular queueing policies.

Author:
gary

Field Summary
protected  java.util.List waiters
          The list of waiting RealtimeThread's
 
Constructor Summary
WaiterSet()
           
 
Method Summary
abstract  RealtimeThread dequeue()
          Dequeue the highest ranked RealtimeThread in the wait set.
abstract  void enqueue(RealtimeThread thread)
          Enqueue a given RealtimeThread in this WaitSet.
abstract  RealtimeThread first()
          Dequeue the highest ranked RealtimeThread in the wait set.
 boolean isEmpty()
          Test if this WaitSet is empty
 java.util.Iterator iterator()
          Construct an iterator on this WaitSet.
 boolean remove(RealtimeThread thread)
          Remove a given thread from this WaiterSet.
 int size()
          Get the number of waiting RealtimeThread's
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

waiters

protected java.util.List waiters
The list of waiting RealtimeThread's

Constructor Detail

WaiterSet

public WaiterSet()
Method Detail

size

public int size()
Get the number of waiting RealtimeThread's

Returns:
the number of waiting threads

dequeue

public abstract RealtimeThread dequeue()
Dequeue the highest ranked RealtimeThread in the wait set.

Returns:
the dequeued RealtimeThread

isEmpty

public boolean isEmpty()
Test if this WaitSet is empty

Returns:
true iff this WaitSet is empty

remove

public boolean remove(RealtimeThread thread)
Remove a given thread from this WaiterSet.

Parameters:
thread - the RealTimeThread to be removed.
Returns:
true if it was removed.

enqueue

public abstract void enqueue(RealtimeThread thread)
Enqueue a given RealtimeThread in this WaitSet.

Parameters:
thread - the thread to be enqueued

first

public abstract RealtimeThread first()
Dequeue the highest ranked RealtimeThread in the wait set. Do not dequeue it.


iterator

public java.util.Iterator iterator()
Construct an iterator on this WaitSet.

Returns:
the iterator