public class Select<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private SelectBase<T> |
selectBase |
Constructor and Description |
---|
Select(PGroup pGroup,
DataflowReadChannel<? extends T>... channels) |
Select(PGroup pGroup,
java.util.List<DataflowReadChannel<? extends T>> channels) |
Modifier and Type | Method and Description |
---|---|
SelectResult<T> |
call()
Selects a value from a single randomly chosen input channel, which has a value available for read.
|
SelectResult<T> |
call(java.util.List<java.lang.Boolean> mask)
Selects a value from a single randomly chosen input channel, which has a value available for read.
|
void |
call(MessageStream messageStream)
Selects a value from a single randomly chosen input channel, which has a value available for read.
|
void |
call(MessageStream messageStream,
java.util.List<java.lang.Boolean> mask)
Selects a value from a single randomly chosen input channel, which has a value available for read.
|
SelectResult<T> |
prioritySelect()
Selects a value from a single input channel, which has a value available for read.
|
SelectResult<T> |
prioritySelect(java.util.List<java.lang.Boolean> mask)
Selects a value from a single input channel, which has a value available for read.
|
void |
prioritySelect(MessageStream messageStream)
Selects a value from a single input channel, which has a value available for read.
|
void |
prioritySelect(MessageStream messageStream,
java.util.List<java.lang.Boolean> mask)
Selects a value from a single input channel, which has a value available for read.
|
SelectResult<T> |
select()
Selects a value from a single randomly chosen input channel, which has a value available for read.
|
private SelectResult<T> |
select(int startIndex,
java.util.List<java.lang.Boolean> mask)
Invokes the internal select base with a SelectRequest instance ensuring the current thread can continue returning the correct value, once a value has been selected
|
SelectResult<T> |
select(java.util.List<java.lang.Boolean> mask)
Selects a value from a single randomly chosen input channel, which has a value available for read.
|
void |
select(MessageStream messageStream)
Selects a value from a single randomly chosen input channel, which has a value available for read.
|
private void |
select(MessageStream messageStream,
int startIndex,
java.util.List<java.lang.Boolean> mask)
Invokes the internal select base with a SelectRequest instance ensuring a message is sent, once a value has been selected
|
void |
select(MessageStream messageStream,
java.util.List<java.lang.Boolean> mask)
Selects a value from a single randomly chosen input channel, which has a value available for read.
|
private final SelectBase<T> selectBase
public Select(PGroup pGroup, DataflowReadChannel<? extends T>... channels)
pGroup
- The group, the thread pool of which should be used for notification message handlerschannels
- The input channels to select frompublic Select(PGroup pGroup, java.util.List<DataflowReadChannel<? extends T>> channels)
pGroup
- The group, the thread pool of which should be used for notification message handlerschannels
- The list of input channels to select frompublic SelectResult<T> select() throws java.lang.InterruptedException
java.lang.InterruptedException
- If the current thread gets interruptedpublic SelectResult<T> select(java.util.List<java.lang.Boolean> mask) throws java.lang.InterruptedException
mask
- A list of boolean values indicating, whether the input channel with the same position index should be included in the selection or notjava.lang.InterruptedException
- If the current thread gets interruptedpublic void select(MessageStream messageStream) throws java.lang.InterruptedException
messageStream
- A message stream accepting the selected value. The message will be of SelectResult type, holding the actual value as well as the channel index.java.lang.InterruptedException
- If the current thread gets interruptedpublic void select(MessageStream messageStream, java.util.List<java.lang.Boolean> mask) throws java.lang.InterruptedException
messageStream
- A message stream accepting the selected value. The message will be of SelectResult type, holding the actual value as well as the channel index.mask
- A list of boolean values indicating, whether the input channel with the same position index should be included in the selection or notjava.lang.InterruptedException
- If the current thread gets interruptedpublic SelectResult<T> prioritySelect() throws java.lang.InterruptedException
java.lang.InterruptedException
- If the current thread gets interruptedpublic SelectResult<T> prioritySelect(java.util.List<java.lang.Boolean> mask) throws java.lang.InterruptedException
mask
- A list of boolean values indicating, whether the input channel with the same position index should be included in the selection or notjava.lang.InterruptedException
- If the current thread gets interruptedpublic void prioritySelect(MessageStream messageStream) throws java.lang.InterruptedException
messageStream
- A message stream accepting the selected value. The message will be of SelectResult type, holding the actual value as well as the channel index.java.lang.InterruptedException
- If the current thread gets interruptedpublic void prioritySelect(MessageStream messageStream, java.util.List<java.lang.Boolean> mask) throws java.lang.InterruptedException
messageStream
- A message stream accepting the selected value. The message will be of SelectResult type, holding the actual value as well as the channel index.mask
- A list of boolean values indicating, whether the input channel with the same position index should be included in the selection or notjava.lang.InterruptedException
- If the current thread gets interruptedpublic final SelectResult<T> call() throws java.lang.InterruptedException
java.lang.InterruptedException
- If the current thread gets interruptedpublic final SelectResult<T> call(java.util.List<java.lang.Boolean> mask) throws java.lang.InterruptedException
mask
- A list of boolean values indicating, whether the input channel with the same position index should be included in the selection or notjava.lang.InterruptedException
- If the current thread gets interruptedpublic final void call(MessageStream messageStream) throws java.lang.InterruptedException
messageStream
- A message stream accepting the selected value. The message will be of SelectResult type, holding the actual value as well as the channel index.java.lang.InterruptedException
- If the current thread gets interruptedpublic final void call(MessageStream messageStream, java.util.List<java.lang.Boolean> mask) throws java.lang.InterruptedException
messageStream
- A message stream accepting the selected value. The message will be of SelectResult type, holding the actual value as well as the channel index.mask
- A list of boolean values indicating, whether the input channel with the same position index should be included in the selection or notjava.lang.InterruptedException
- If the current thread gets interruptedprivate void select(MessageStream messageStream, int startIndex, java.util.List<java.lang.Boolean> mask) throws java.lang.InterruptedException
java.lang.InterruptedException
private SelectResult<T> select(int startIndex, java.util.List<java.lang.Boolean> mask) throws java.lang.InterruptedException
java.lang.InterruptedException