devutil
Class QueueMux

java.lang.Object
  extended bydevutil.QueueMux

public class QueueMux
extends java.lang.Object


Field Summary
private  int current
           
private  Queue[] queues
           
 
Constructor Summary
QueueMux(Queue[] queues)
          Creates the array of queues managed by this class.
 
Method Summary
 void add(java.lang.Object item)
           
 java.util.Enumeration elements()
           
 int getCurrentActiveQueue()
          Returns the index of the queue currently active.
 Queue[] getQueues()
          Gets back the array of queues.
 boolean isEmpty()
           
 java.lang.Object remove()
          Blocks if the queue is empty.
 void setActiveQueue(int index)
          Sets the queue on which the operations are performed.
 int size()
           
 void waitUntilEmpty()
          It blocks until the queue is empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queues

private Queue[] queues

current

private int current
Constructor Detail

QueueMux

public QueueMux(Queue[] queues)
Creates the array of queues managed by this class.

Method Detail

getQueues

public Queue[] getQueues()
Gets back the array of queues.


setActiveQueue

public void setActiveQueue(int index)
Sets the queue on which the operations are performed. Default is 0, i.e., the first one in the array.


remove

public java.lang.Object remove()
Blocks if the queue is empty.


add

public void add(java.lang.Object item)

waitUntilEmpty

public void waitUntilEmpty()
It blocks until the queue is empty.


elements

public java.util.Enumeration elements()

isEmpty

public boolean isEmpty()

size

public int size()

getCurrentActiveQueue

public int getCurrentActiveQueue()
Returns the index of the queue currently active.