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

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

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

Adapter to turn a binary lambda into an N-ary lambda (with N=2).


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

Field Detail

_decoree

private ILambda.Binary<R,P,P> _decoree
The binary lambda.

Constructor Detail

ILambda.Nary.BinaryAdaptor

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

Parameters:
decoree - binary lambda
Method Detail

apply

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

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