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

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

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

Adapter to turn a unary lambda into an N-ary lambda (with N=1).


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  ILambda<R,P> _decoree
          The unary lambda.
 
Constructor Summary
ILambda.Nary.UnaryAdaptor(ILambda<R,P> decoree)
          Creates a new N-ary lambda (with N=1).
 
Method Summary
 R apply(P... param)
          Apply the unary lambda.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_decoree

private ILambda<R,P> _decoree
The unary lambda.

Constructor Detail

ILambda.Nary.UnaryAdaptor

public ILambda.Nary.UnaryAdaptor(ILambda<R,P> decoree)
Creates a new N-ary lambda (with N=1).

Parameters:
decoree - unary lambda
Method Detail

apply

public R apply(P... param)
Apply the unary lambda.

Specified by:
apply in interface ILambda.Nary<R,P>
Parameters:
param - exactly one parameter.
Returns:
return value of the unary lambda
Throws:
java.lang.IllegalArgumentException - if param.length != 1