org.gridgain.grid.lang
Class GridInClosure2<E1,E2>
java.lang.Object
org.gridgain.grid.lang.GridMetadataAwareAdapter
org.gridgain.grid.lang.GridLambdaAdapter
org.gridgain.grid.lang.GridInClosure2<E1,E2>
- Type Parameters:
E1 - Type of the first free variable, i.e. the element the closure is called or closed on.E2 - Type of the second free variable, i.e. the element the closure is called or closed on.
- All Implemented Interfaces:
- Serializable, Cloneable, GridMetadataAware, GridPeerDeployAware, GridLambda
- Direct Known Subclasses:
- CI2, GridInClosure2X
public abstract class GridInClosure2<E1,E2>
- extends GridLambdaAdapter
Defines a convenient side-effect only closure, i.e. the closure that has void return type.
Since Java 6 doesn't provide a language construct for first-class function the closures are
implemented as interfaces.
To provide for more terse code you can use a typedef CI2
class or various factory methods in GridFunc class. Note, however, that since typedefs
in Java rely on inheritance you should not use these type aliases in signatures.
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.
- See Also:
C2,
GridFunc,
Serialized Form
-

|
Method Summary |
abstract void |
apply(E1 e1,
E2 e2)
Closure body. |
GridInClosure<E2> |
curry(E1 e1)
Curries this closure with given value. |
GridAbsClosure |
curry(E1 e1,
E2 e2)
Curries this closure with given values. |
|
uncurry3()
Gets closure that ignores its third argument and executes the same way as this
in-closure with first and second arguments. |
| 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 interface org.gridgain.grid.GridMetadataAware |
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta |
GridInClosure2
public GridInClosure2()
apply
public abstract void apply(E1 e1,
E2 e2)
- Closure body.
- Parameters:
e1 - First bound free variable, i.e. the element the closure is called or closed on.e2 - Second bound free variable, i.e. the element the closure is called or closed on.
curry
public GridInClosure<E2> curry(E1 e1)
- Curries this closure with given value. When result closure is called it will
be executed with given value.
- Parameters:
e1 - Value to curry with.
- Returns:
- Curried or partially applied closure with given value.
curry
public GridAbsClosure curry(E1 e1,
E2 e2)
- Curries this closure with given values. When result closure is called it will
be executed with given values.
- Parameters:
e1 - Value to curry with.e2 - Value to curry with.
- Returns:
- Curried or partially applied closure with given values.
uncurry3
public <E3> GridInClosure3<E1,E2,E3> uncurry3()
- Gets closure that ignores its third argument and executes the same way as this
in-closure with first and second arguments.
- Type Parameters:
E3 - Type of 3d argument that is ignored.
- Returns:
- Closure that ignores its third argument and executes the same way as this
in-closure with first and second arguments.