public class ReceiverQueues
extends java.lang.Object
LinkedBlockingQueue
s.
Sent data is branched to all queues.Constructor and Description |
---|
ReceiverQueues(java.util.Vector<java.util.concurrent.LinkedBlockingQueue<DataEntry>> receivers)
Constructs the
ReceiverQueues by setting up all the connection
between the incoming data and the provided list of receivers. |
Modifier and Type | Method and Description |
---|---|
void |
add(DataEntry e)
Adds data to the data-queues.
|
void |
addReceiver(java.util.concurrent.LinkedBlockingQueue<DataEntry> receiver)
Adds another
LinkedBlockingQueue to the list of receivers. |
void |
clear()
Clears all data from all receiving
LinkedBlockingQueue . |
void |
put(DataEntry e)
Puts data to the data-queues.
|
int |
remainingCapacity()
Calculates smallest remaining capacity of all the data-queues.
|
public ReceiverQueues(java.util.Vector<java.util.concurrent.LinkedBlockingQueue<DataEntry>> receivers)
ReceiverQueues
by setting up all the connection
between the incoming data and the provided list of receivers.receivers
- the list of receivers that expect the datapublic void addReceiver(java.util.concurrent.LinkedBlockingQueue<DataEntry> receiver)
LinkedBlockingQueue
to the list of receivers.receiver
- the new LinkedBlockingQueue
to addpublic void clear()
LinkedBlockingQueue
.public void add(DataEntry e) throws java.lang.NullPointerException
e
- data to be inserted.java.lang.InterruptedException
- if waiting for the queue-capacity is interrupted.java.lang.NullPointerException
- if the data to be sent is null.AbstractQueue.add(Object)
,
put(DataEntry)
public void put(DataEntry e) throws java.lang.InterruptedException, java.lang.NullPointerException
e
- data to be inserted.java.lang.InterruptedException
- if waiting for the queue-capacity is interrupted.java.lang.NullPointerException
- if the data to be sent is null.LinkedBlockingQueue.put(Object)
,
add(DataEntry)
public int remainingCapacity()