package fp; import listFW.*; import listFW.factory.*; public class Cons2 implements ILambda2 { IListFactory _fac; public Cons2(IListFactory fac) { _fac = fac; } /** * Creates an NEList with a given first and rest. * @param first the first element of the IList to be created. * @param rest an IList, the rest of the IList to be created. * @return IList */ public Object apply(Object first, Object rest) { return _fac.makeNEList(first, (IList)rest); } }