edu.rice.cs.cunit.util
Class ILambda.Nary.Bind<R,P>

java.lang.Object
  extended by edu.rice.cs.cunit.util.ILambda.Nary.Bind<R,P>
All Implemented Interfaces:
ILambda.Nary<R,P>
Enclosing interface:
ILambda.Nary<R,P>

public static class ILambda.Nary.Bind<R,P>
extends java.lang.Object
implements ILambda.Nary<R,P>

(N-1)-ary decorator for an N-ary lambda that binds a constant to one of its parameters.


Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.rice.cs.cunit.util.ILambda.Nary
ILambda.Nary.BinaryAdaptor<R,P>, ILambda.Nary.Bind<R,P>, ILambda.Nary.BindK<R,P>, ILambda.Nary.Max<T extends java.lang.Comparable<T>>, ILambda.Nary.Min<T extends java.lang.Comparable<T>>, ILambda.Nary.TernaryAdaptor<R,P>, ILambda.Nary.UnaryAdaptor<R,P>
 
Field Summary
private  P _constant
          The constant argument.
private  ILambda.Nary<R,P> _decoree
          The N-ary lambda.
private  int _index
          The index of the constant parameter.
 
Constructor Summary
ILambda.Nary.Bind(ILambda.Nary<R,P> decoree, int index, P constant)
          Creates a new (N-1)-ary decorator for an N-ary lambda, binding a constant to one of its parameters.
 
Method Summary
 R apply(P... param)
          Apply the (N-1)-ary decorator, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_index

private int _index
The index of the constant parameter.


_constant

private P _constant
The constant argument.


_decoree

private ILambda.Nary<R,P> _decoree
The N-ary lambda.

Constructor Detail

ILambda.Nary.Bind

public ILambda.Nary.Bind(ILambda.Nary<R,P> decoree,
                         int index,
                         P constant)
Creates a new (N-1)-ary decorator for an N-ary lambda, binding a constant to one of its parameters.

Parameters:
decoree - N-ary lambda
index - index of the constant parameter, 0 <= index < N
constant - constant for the specified parameter
Method Detail

apply

public R apply(P... param)
Apply the (N-1)-ary decorator, i.e. apply the N-ary lambda with the constant spliced into the given (N-1) arguments.

Specified by:
apply in interface ILambda.Nary<R,P>
Parameters:
param - (N-1) arguments
Returns:
return value of the N-ary lambda