GridGain™ 3.6.0e
Enterprise Edition

org.gridgain.grid.lang
Class GridInClosure<E1>

java.lang.Object
  extended by org.gridgain.grid.lang.GridMetadataAwareAdapter
      extended by org.gridgain.grid.lang.GridLambdaAdapter
          extended by org.gridgain.grid.lang.GridInClosure<E1>
Type Parameters:
E1 - Type of the free variable, i.e. the element the closure is called or closed on.
All Implemented Interfaces:
Serializable, Cloneable, GridMetadataAware, GridPeerDeployAware, GridLambda
Direct Known Subclasses:
CI1, GridInClosureX

public abstract class GridInClosure<E1>
extends GridLambdaAdapter

Defines a convenient side-effect only closure, i.e. the closure that has void return type.

Thread Safety

Note that this interface does not impose or assume any specific thread-safety by its implementations. Each implementation can elect what type of thread-safety it provides, if any.

Wiki & Forum:


Wiki
Forum

See Also:
GridFunc, Serialized Form
 

Constructor Summary
GridInClosure()
           
 
Method Summary
abstract  void apply(E1 t)
          In-closure body.
<A> GridInClosure<A>
compose(GridClosure<A,E1> c)
          Gets closure that applies this closure over the result of given closure.
<A1,A2> GridInClosure2<A1,A2>
compose(GridClosure2<A1,A2,E1> c)
          Gets closure that applies this closure over the result of given closure.
<A1,A2,A3> GridInClosure3<A1,A2,A3>
compose(GridClosure3<A1,A2,A3,E1> c)
          Gets closure that applies this closure over the result of given closure.
 GridAbsClosure compose(GridOutClosure<E1> c)
          Gets closure that applies this closure over the result of given closure.
 GridAbsClosure curry(E1 t)
          Curries this closure with given value.
<E2> GridInClosure2<E1,E2>
uncurry2()
          Gets closure that ignores its second argument and executes the same way as this in-closure with just one first argument.
<E2,E3> GridInClosure3<E1,E2,E3>
uncurry3()
          Gets closure that ignores its second and third arguments and executes the same way as this in-closure with just one first argument.
 
Methods inherited from class org.gridgain.grid.lang.GridLambdaAdapter
classLoader, deployClass, peerDeployLike, withMeta
 
Methods inherited from class org.gridgain.grid.lang.GridMetadataAwareAdapter
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, readExternalMeta, removeMeta, removeMeta, replaceMeta, writeExternalMeta
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.gridgain.grid.GridMetadataAware
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta
 

Constructor Detail

GridInClosure

public GridInClosure()
Method Detail

apply

public abstract void apply(E1 t)
In-closure body.

Parameters:
t - Bound free variable, i.t. the element the closure is called or closed on.

curry

public GridAbsClosure curry(E1 t)
Curries this closure with given value. When result closure is called it will be executed with given value.

Parameters:
t - Value to curry with.
Returns:
Curried or partially applied closure with given value.

uncurry2

public <E2> GridInClosure2<E1,E2> uncurry2()
Gets closure that ignores its second argument and executes the same way as this in-closure with just one first argument.

Type Parameters:
E2 - Type of 2nd argument that is ignored.
Returns:
Closure that ignores its second argument and executes the same way as this in-closure with just one first argument.

uncurry3

public <E2,E3> GridInClosure3<E1,E2,E3> uncurry3()
Gets closure that ignores its second and third arguments and executes the same way as this in-closure with just one first argument.

Type Parameters:
E2 - Type of 2nd argument that is ignored.
E3 - Type of 3d argument that is ignored.
Returns:
Closure that ignores its second and third arguments and executes the same way as this in-closure with just one first argument.

compose

public GridAbsClosure compose(GridOutClosure<E1> c)
Gets closure that applies this closure over the result of given closure.

Parameters:
c - Closure.
Returns:
New closure.

compose

public <A> GridInClosure<A> compose(GridClosure<A,E1> c)
Gets closure that applies this closure over the result of given closure.

Type Parameters:
A - Argument type of new closure.
Parameters:
c - Closure.
Returns:
New closure.

compose

public <A1,A2> GridInClosure2<A1,A2> compose(GridClosure2<A1,A2,E1> c)
Gets closure that applies this closure over the result of given closure.

Type Parameters:
A1 - First argument type of new closure.
A2 - Second argument type of new closure.
Parameters:
c - Closure.
Returns:
New closure.

compose

public <A1,A2,A3> GridInClosure3<A1,A2,A3> compose(GridClosure3<A1,A2,A3,E1> c)
Gets closure that applies this closure over the result of given closure.

Type Parameters:
A1 - First argument type of new closure.
A2 - Second argument type of new closure.
A3 - Third argument type of new closure.
Parameters:
c - Closure.
Returns:
New closure.

GridGain™ 3.6.0e
Enterprise Edition

GridGain - Real Time Big Data
Enterprise Edition, ver. 3.6.0e.13012012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Follow GridGain on Facebook Join GridGain User Group Follow GridGain on Twitter Follow GridGain on YouTube