its.element
Class FrameQueue

java.lang.Object
  extended byits.element.FrameQueue
All Implemented Interfaces:
FrameTarget

public class FrameQueue
extends java.lang.Object
implements FrameTarget


Constructor Summary
FrameQueue()
           
 
Method Summary
 void add(ItsFrame newFrame)
          Pushes an ItsFrame onto the end of the queue and notifies threads that are waiting for a frame to arrive.
 ItsFrame remove()
          Returns the next ItsFrame to be processed.
 void setWarningLimits(int low, int high)
          When the number of elements in the frame queue exceeds the given warningHigh parameter (set to 100 by default), a warning message is generated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameQueue

public FrameQueue()
Method Detail

remove

public ItsFrame remove()
                throws java.lang.InterruptedException
Returns the next ItsFrame to be processed. If there are no frames currently available, waits for one to arrive.

Throws:
java.lang.InterruptedException

add

public void add(ItsFrame newFrame)
Pushes an ItsFrame onto the end of the queue and notifies threads that are waiting for a frame to arrive.

Specified by:
add in interface FrameTarget

setWarningLimits

public void setWarningLimits(int low,
                             int high)
When the number of elements in the frame queue exceeds the given warningHigh parameter (set to 100 by default), a warning message is generated. Subsequently, if the frame queue length goes down to the given warningLow parameter (set to 50 by default), another message is generated. Programs that process a continuous stream of data must take responsibility for consuming the data at least as quickly as it is produced. If they do not, the frame queue continues to grow and eventually the program runs out of memory.