inria.util
Class FIFOQueue

java.lang.Object
  |
  +--inria.util.FIFOQueue

public class FIFOQueue
extends java.lang.Object

This class implements the first in first out queue.


Constructor Summary
FIFOQueue(int maxSize)
          Constructs a FIFOQueue instance.
 
Method Summary
 void clear()
          Clears the queue.
 java.lang.Object dequeue()
          Dequeues an object from the queue.
 void enqueue(java.lang.Object obj)
          Enqueues the given object.
 int getSize()
          Returns the number of objects in the queue.
 void sync()
          The calling thread will be blocked until the queue is empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIFOQueue

public FIFOQueue(int maxSize)
Constructs a FIFOQueue instance.
Parameters:
maxSize - the maximum size of the queue.
Method Detail

enqueue

public void enqueue(java.lang.Object obj)
Enqueues the given object. The calling thread will be blocked if the queue is full.
Parameters:
obj - the object to be added to the queue.

dequeue

public java.lang.Object dequeue()
Dequeues an object from the queue.

sync

public void sync()
The calling thread will be blocked until the queue is empty.

getSize

public int getSize()
Returns the number of objects in the queue.

clear

public void clear()
Clears the queue.


JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.