org.codehaus.gpars

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

java.lang.Object
  groovy.lang.GroovyObjectSupport
      groovy.lang.Closure
          groovyx.gpars.dataflow.impl.SelectCallback

public final class SelectCallback
extends groovy.lang.Closure

A closure registered with all the input channels on the wheneverBound() event to inform the Select about a value being available in a particular channel.

Authors:
Vaclav Pech Date: 30th Sep 2010


Field Summary
private DataflowReadChannel channel

private int index

private static long serialVersionUID

 
Fields inherited from class groovy.lang.Closure
OWNER_FIRST, DELEGATE_FIRST, OWNER_ONLY, DELEGATE_ONLY, TO_SELF, DONE, SKIP
 
Constructor Summary
SelectCallback(java.lang.Object owner, int index, DataflowReadChannel channel)

@param owner The SelectBase instance to notify

 
Method Summary
java.lang.Object call(Object[] args)

Invoked by the channel when a value has been bound to it and is available for consumption

 
Methods inherited from class groovy.lang.Closure
groovy.lang.Closure#run(), groovy.lang.Closure#setProperty(java.lang.String, java.lang.Object), groovy.lang.Closure#getProperty(java.lang.String), groovy.lang.Closure#clone(), groovy.lang.Closure#getParameterTypes(), groovy.lang.Closure#setDelegate(java.lang.Object), groovy.lang.Closure#getOwner(), groovy.lang.Closure#call([Ljava.lang.Object;), groovy.lang.Closure#call(java.lang.Object), groovy.lang.Closure#call(), groovy.lang.Closure#isCase(java.lang.Object), groovy.lang.Closure#getMaximumNumberOfParameters(), groovy.lang.Closure#setResolveStrategy(int), groovy.lang.Closure#getResolveStrategy(), groovy.lang.Closure#getThisObject(), groovy.lang.Closure#getDelegate(), groovy.lang.Closure#getDirective(), groovy.lang.Closure#asWritable(), groovy.lang.Closure#curry([Ljava.lang.Object;), groovy.lang.Closure#rcurry([Ljava.lang.Object;), groovy.lang.Closure#ncurry(int, [Ljava.lang.Object;), groovy.lang.Closure#setDirective(int), groovy.lang.Closure#getMetaClass(), groovy.lang.Closure#setMetaClass(groovy.lang.MetaClass), groovy.lang.Closure#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Closure#wait(long), groovy.lang.Closure#wait(), groovy.lang.Closure#wait(long, int), groovy.lang.Closure#equals(java.lang.Object), groovy.lang.Closure#toString(), groovy.lang.Closure#hashCode(), groovy.lang.Closure#getClass(), groovy.lang.Closure#notify(), groovy.lang.Closure#notifyAll()
 
Methods inherited from class groovy.lang.GroovyObjectSupport
groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()
 
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

channel

private final DataflowReadChannel channel


index

private final int index


serialVersionUID

private static final long serialVersionUID


 
Constructor Detail

SelectCallback

public SelectCallback(java.lang.Object owner, int index, DataflowReadChannel channel)
Parameters:
owner - The SelectBase instance to notify
index - The index of the channel this SelectCallback instance represents
channel - The channel represented by this SelectCallback instance


 
Method Detail

call

@SuppressWarnings({"unchecked"})
@Override
public java.lang.Object call(Object[] args)
Invoked by the channel when a value has been bound to it and is available for consumption
Parameters:
args - Holds the value, but we do not work with the value here
Returns:
A dummy string, since the caller doesn't check the return value


 

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