org.codehaus.gpars

groovyx.gpars.dataflow.impl
[Java] Class GuardedSelectRequest

java.lang.Object
  groovyx.gpars.dataflow.impl.GuardedSelectRequest
All Implemented Interfaces:
SelectRequest

public abstract class GuardedSelectRequest

The base implementation of the SelectRequest interface, providing a useful default masking (guarding) functionality. Whenever invoking a select, guards can be specified, reducing the set of all input channels of the Select to consider in the given request.

Authors:
Vaclav Pech Date: 30th Sep 2010


Field Summary
private java.util.List mask

 
Constructor Summary
GuardedSelectRequest(java.util.List mask)

Parameters:
mask - The list of boolean flags indicating which position should be matched against.

 
Method Summary
boolean matchesMask(int index)

Detects, whether the channel at the given index is guarded or not.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

mask

private final java.util.List mask


 
Constructor Detail

GuardedSelectRequest

@SuppressWarnings({"ConstructorNotProtectedInAbstractClass", "AssignmentToCollectionOrArrayFieldFromParameter"})
public GuardedSelectRequest(java.util.List mask)
Parameters:
mask - The list of boolean flags indicating which position should be matched against. All indexes match against a null mask


 
Method Detail

matchesMask

@Override
public boolean matchesMask(int index)
Detects, whether the channel at the given index is guarded or not.
Parameters:
index - The index of the input channel to check for guard
Returns:
True, if the channel's guard is true or no guards were set and so the channel should be included in the current select operation


 

Copyright © 2008–2012 Václav Pech. All Rights Reserved.